public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle•com>
To: Felix Fietkau <nbd@openwrt•org>, John Crispin <blogic@openwrt•org>
Cc: Matthias Brugger <matthias.bgg@gmail•com>,
	netdev@vger•kernel.org, linux-mediatek@lists•infradead.org,
	kernel-janitors@vger•kernel.org
Subject: [patch 1/2 net-next] mediatek: checking for IS_ERR() instead of NULL
Date: Tue, 15 Mar 2016 10:18:49 +0300	[thread overview]
Message-ID: <20160315071849.GH13560@mwanda> (raw)

of_phy_connect() returns NULL on error, it never returns error pointers.

Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle•com>

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index ba3afa5..9759fe5 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -186,9 +186,9 @@ static int mtk_phy_connect_node(struct mtk_eth *eth, struct mtk_mac *mac,
 
 	phydev = of_phy_connect(eth->netdev[mac->id], phy_node,
 				mtk_phy_link_adjust, 0, phy_mode);
-	if (IS_ERR(phydev)) {
+	if (!phydev) {
 		dev_err(eth->dev, "could not connect to PHY\n");
-		return PTR_ERR(phydev);
+		return -ENODEV;
 	}
 
 	dev_info(eth->dev,

             reply	other threads:[~2016-03-15  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15  7:18 Dan Carpenter [this message]
2016-03-15  7:27 ` [patch 1/2 net-next] mediatek: checking for IS_ERR() instead of NULL John Crispin
2016-03-18 22:31 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160315071849.GH13560@mwanda \
    --to=dan.carpenter@oracle$(echo .)com \
    --cc=blogic@openwrt$(echo .)org \
    --cc=kernel-janitors@vger$(echo .)kernel.org \
    --cc=linux-mediatek@lists$(echo .)infradead.org \
    --cc=matthias.bgg@gmail$(echo .)com \
    --cc=nbd@openwrt$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox