public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Albert ARIBAUD (3ADEV)" <albert.aribaud@3adev.fr>
To: netdev@vger.kernel.org
Cc: Jiri Kosina <trivial@kernel.org>, Fugang Duan <fugang.duan@nxp.com>
Subject: [PATCH] net: trivial: fix fsl fec_main mdio write return value
Date: Mon, 26 Sep 2016 21:11:40 +0200	[thread overview]
Message-ID: <20160926191140.12107-1-albert.aribaud@3adev.fr> (raw)

If the MDIO enf-of-transfer wait loop does not time out,
0 should be returned to the caller through ret, but ret
was not reset to 0 after receiving the return value of
pm_runtime_get_sync(). Reset ret when no time out occurred.

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
---
 drivers/net/ethernet/freescale/fec_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 01f7e81..0413c05 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1818,6 +1818,8 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
 		netdev_err(fep->netdev, "MDIO write timeout\n");
 		ret  = -ETIMEDOUT;
 	}
+	else
+		ret = 0;
 
 	pm_runtime_mark_last_busy(dev);
 	pm_runtime_put_autosuspend(dev);
-- 
2.9.3

             reply	other threads:[~2016-09-26 19:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 19:11 Albert ARIBAUD (3ADEV) [this message]
2016-09-26 19:15 ` [PATCH] net: trivial: fix fsl fec_main mdio write return value Albert ARIBAUD
2016-09-26 21:00 ` Fabio Estevam
2016-09-26 21:10   ` Albert ARIBAUD
2016-09-26 22:10 ` Sergei Shtylyov

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=20160926191140.12107-1-albert.aribaud@3adev.fr \
    --to=albert.aribaud@3adev.fr \
    --cc=fugang.duan@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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