Skip to content

Commit aeddb6d

Browse files
committed
Merge branch 'emaclite-fixes'
Radhey Shyam Pandey says: ==================== emaclite bug fixes and code cleanup This patch series fixes bug in emaclite remove and mdio_setup routines. It does minor code cleanup. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 4fd44a9 + 560c5bd commit aeddb6d

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/net/ethernet/xilinx/xilinx_emaclite.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
* @phy_node: pointer to the PHY device node
124124
* @mii_bus: pointer to the MII bus
125125
* @last_link: last link status
126-
* @has_mdio: indicates whether MDIO is included in the HW
127126
*/
128127
struct net_local {
129128

@@ -144,7 +143,6 @@ struct net_local {
144143
struct mii_bus *mii_bus;
145144

146145
int last_link;
147-
bool has_mdio;
148146
};
149147

150148

@@ -863,14 +861,14 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
863861
bus->write = xemaclite_mdio_write;
864862
bus->parent = dev;
865863

866-
lp->mii_bus = bus;
867-
868864
rc = of_mdiobus_register(bus, np);
869865
if (rc) {
870866
dev_err(dev, "Failed to register mdio bus.\n");
871867
goto err_register;
872868
}
873869

870+
lp->mii_bus = bus;
871+
874872
return 0;
875873

876874
err_register:
@@ -1145,9 +1143,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
11451143
xemaclite_update_address(lp, ndev->dev_addr);
11461144

11471145
lp->phy_node = of_parse_phandle(ofdev->dev.of_node, "phy-handle", 0);
1148-
rc = xemaclite_mdio_setup(lp, &ofdev->dev);
1149-
if (rc)
1150-
dev_warn(&ofdev->dev, "error registering MDIO bus\n");
1146+
xemaclite_mdio_setup(lp, &ofdev->dev);
11511147

11521148
dev_info(dev, "MAC address is now %pM\n", ndev->dev_addr);
11531149

@@ -1191,7 +1187,7 @@ static int xemaclite_of_remove(struct platform_device *of_dev)
11911187
struct net_local *lp = netdev_priv(ndev);
11921188

11931189
/* Un-register the mii_bus, if configured */
1194-
if (lp->has_mdio) {
1190+
if (lp->mii_bus) {
11951191
mdiobus_unregister(lp->mii_bus);
11961192
mdiobus_free(lp->mii_bus);
11971193
lp->mii_bus = NULL;

0 commit comments

Comments
 (0)