[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <70ec73ad-19aa-76aa-168b-b9a2a6911938@web.de>
Date: Fri, 27 Sep 2019 10:18:27 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: netdev@...r.kernel.org,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Heiner Kallweit <hkallweit1@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH v2 2/2] net: phy: mscc-miim: Move the setting of mii_bus
structure members in mscc_miim_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 27 Sep 2019 09:30:14 +0200
Move the modification of some members in the data structure “mii_bus”
for the local variable “bus” directly before the call of
the function “of_mdiobus_register” so that this change will be performed
only after previous resource allocations succeeded.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
v2:
This suggestion was repeated based on the change for the previous update step.
drivers/net/phy/mdio-mscc-miim.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/phy/mdio-mscc-miim.c b/drivers/net/phy/mdio-mscc-miim.c
index aabb13982251..a270f83bb207 100644
--- a/drivers/net/phy/mdio-mscc-miim.c
+++ b/drivers/net/phy/mdio-mscc-miim.c
@@ -124,13 +124,6 @@ static int mscc_miim_probe(struct platform_device *pdev)
if (!bus)
return -ENOMEM;
- bus->name = "mscc_miim";
- bus->read = mscc_miim_read;
- bus->write = mscc_miim_write;
- bus->reset = mscc_miim_reset;
- snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev));
- bus->parent = &pdev->dev;
-
dev = bus->priv;
dev->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(dev->regs)) {
@@ -147,6 +140,12 @@ static int mscc_miim_probe(struct platform_device *pdev)
}
}
+ bus->name = "mscc_miim";
+ bus->read = mscc_miim_read;
+ bus->write = mscc_miim_write;
+ bus->reset = mscc_miim_reset;
+ snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev));
+ bus->parent = &pdev->dev;
ret = of_mdiobus_register(bus, pdev->dev.of_node);
if (ret < 0) {
dev_err(&pdev->dev, "Cannot register MDIO bus (%d)\n", ret);
--
2.23.0
Powered by blists - more mailing lists