From: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
To: <davem@davemloft.net>, <michal.simek@xilinx.com>,
<radhey.shyam.pandey@xilinx.com>
Cc: <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 2/4] net: emaclite: Fix MDIO bus unregister bug
Date: Wed, 13 Jun 2018 12:05:17 +0530 [thread overview]
Message-ID: <1528871719-1681-3-git-send-email-radhey.shyam.pandey@xilinx.com> (raw)
In-Reply-To: <1528871719-1681-1-git-send-email-radhey.shyam.pandey@xilinx.com>
Since 'has_mdio' flag is not used,sequence insmod->rmmod-> insmod
leads to failure as MDIO unregister doesn't happen in .remove().
Fix it by checking MII bus pointer instead.
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index 37989ce..06eb6c8 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1191,7 +1191,7 @@ static int xemaclite_of_remove(struct platform_device *of_dev)
struct net_local *lp = netdev_priv(ndev);
/* Un-register the mii_bus, if configured */
- if (lp->has_mdio) {
+ if (lp->mii_bus) {
mdiobus_unregister(lp->mii_bus);
mdiobus_free(lp->mii_bus);
lp->mii_bus = NULL;
--
1.7.1
next prev parent reply other threads:[~2018-06-13 6:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 6:35 [PATCH 0/4] emaclite bug fixes and code cleanup Radhey Shyam Pandey
2018-06-13 6:35 ` [PATCH 1/4] net: emaclite: Fix position of lp->mii_bus assignment Radhey Shyam Pandey
2018-06-13 7:21 ` Andrew Lunn
2018-06-13 6:35 ` Radhey Shyam Pandey [this message]
2018-06-13 7:23 ` [PATCH 2/4] net: emaclite: Fix MDIO bus unregister bug Andrew Lunn
2018-06-13 6:35 ` [PATCH 3/4] net: emaclite: Remove unused 'has_mdio' flag Radhey Shyam Pandey
2018-06-13 7:23 ` Andrew Lunn
2018-06-13 6:35 ` [PATCH 4/4] net: emaclite: Remove xemaclite_mdio_setup return check Radhey Shyam Pandey
2018-06-13 7:29 ` Andrew Lunn
2018-06-13 16:02 ` Radhey Shyam Pandey
2018-06-15 0:08 ` [PATCH 0/4] emaclite bug fixes and code cleanup 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=1528871719-1681-3-git-send-email-radhey.shyam.pandey@xilinx.com \
--to=radhey.shyam.pandey@xilinx.com \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).