There is literally one single bbmiiphy bus in this driver,
remove the bus index handling.

Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Christian Marangi <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Jerome Forissier <[email protected]>
Cc: Jim Liu <[email protected]>
Cc: Joe Hershberger <[email protected]>
Cc: Mario Six <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Nobuhiro Iwamatsu <[email protected]>
Cc: Paul Barker <[email protected]>
Cc: Ramon Fried <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Sughosh Ganu <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
---
V2: New patch
V3: No change
---
 drivers/net/designware.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 95a459cec2a..de697060d28 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -905,8 +905,6 @@ int designware_eth_probe(struct udevice *dev)
 
 #if IS_ENABLED(CONFIG_BITBANGMII) && IS_ENABLED(CONFIG_DM_GPIO)
        if (dev_read_bool(dev, "snps,bitbang-mii")) {
-               int bus_idx;
-
                debug("\n%s: use bitbang mii..\n", dev->name);
                ret = gpio_request_by_name(dev, "snps,mdc-gpio", 0,
                                           &priv->mdc_gpio, GPIOD_IS_OUT
@@ -924,16 +922,11 @@ int designware_eth_probe(struct udevice *dev)
                }
                priv->bb_delay = dev_read_u32_default(dev, 
"snps,bitbang-delay", 1);
 
-               for (bus_idx = 0; bus_idx < bb_miiphy_buses_num; bus_idx++) {
-                       if (!bb_miiphy_buses[bus_idx].priv) {
-                               bb_miiphy_buses[bus_idx].priv = priv;
-                               strlcpy(bb_miiphy_buses[bus_idx].name, 
priv->bus->name,
-                                       MDIO_NAME_LEN);
-                               priv->bus->read = bb_miiphy_read;
-                               priv->bus->write = bb_miiphy_write;
-                               break;
-                       }
-               }
+               bb_miiphy_buses[0].priv = priv;
+               strlcpy(bb_miiphy_buses[0].name, priv->bus->name,
+                       MDIO_NAME_LEN);
+               priv->bus->read = bb_miiphy_read;
+               priv->bus->write = bb_miiphy_write;
        }
 #endif
        ret = dw_phy_init(priv, dev);
-- 
2.47.2

Reply via email to