0057-net-mediatek-checking-for-IS_ERR-instead-of-NULL.patch 979 B

123456789101112131415161718192021222324252627
  1. From b9f9b937dd12dc57bd54a6c89b18eb40d4508424 Mon Sep 17 00:00:00 2001
  2. From: Dan Carpenter <dan.carpenter@oracle.com>
  3. Date: Tue, 15 Mar 2016 10:18:49 +0300
  4. Subject: [PATCH 057/102] net: mediatek: checking for IS_ERR() instead of NULL
  5. of_phy_connect() returns NULL on error, it never returns error pointers.
  6. Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet')
  7. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
  8. ---
  9. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++--
  10. 1 file changed, 2 insertions(+), 2 deletions(-)
  11. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  12. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  13. @@ -186,9 +186,9 @@ static int mtk_phy_connect_node(struct m
  14. phydev = of_phy_connect(eth->netdev[mac->id], phy_node,
  15. mtk_phy_link_adjust, 0, phy_mode);
  16. - if (IS_ERR(phydev)) {
  17. + if (!phydev) {
  18. dev_err(eth->dev, "could not connect to PHY\n");
  19. - return PTR_ERR(phydev);
  20. + return -ENODEV;
  21. }
  22. dev_info(eth->dev,