]> git.sur5r.net Git - u-boot/commitdiff
net: xilinx: Use mdio_register_seq() to support multiple instances
authorMichal Simek <michal.simek@xilinx.com>
Thu, 8 Dec 2016 09:25:44 +0000 (10:25 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 20 Dec 2016 06:40:04 +0000 (07:40 +0100)
axi_emac, emaclite and gem have the same issue with registering
multiple instances with mdio busses. mdio bus name has to be uniq but
drivers are setting up only one name for all.
Use mdio_register_seq() and pass dev->seq number to allow multiple
mdio instances registration.

Reported-by: Phani Kiran Kara <phanikiran.kara@gmail.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/xilinx_axi_emac.c
drivers/net/xilinx_emaclite.c
drivers/net/zynq_gem.c

index 5de06ef01e8d256f039db10ca2db59e19e37997b..51c74266637cc9c5747c289f07ab3adf58c1ecb3 100644 (file)
@@ -648,9 +648,8 @@ static int axi_emac_probe(struct udevice *dev)
        priv->bus->read = axiemac_miiphy_read;
        priv->bus->write = axiemac_miiphy_write;
        priv->bus->priv = priv;
-       strcpy(priv->bus->name, "axi_emac");
 
-       ret = mdio_register(priv->bus);
+       ret = mdio_register_seq(priv->bus, dev->seq);
        if (ret)
                return ret;
 
index 78ff44c5619f870f933d4afcb7ccba2aa0d79d19..ea93cf906ed76063ab0577dfd314f6fc1c8e2431 100644 (file)
@@ -566,9 +566,8 @@ static int emaclite_probe(struct udevice *dev)
        emaclite->bus->read = emaclite_miiphy_read;
        emaclite->bus->write = emaclite_miiphy_write;
        emaclite->bus->priv = emaclite;
-       strcpy(emaclite->bus->name, "emaclite");
 
-       ret = mdio_register(emaclite->bus);
+       ret = mdio_register_seq(emaclite->bus, dev->seq);
        if (ret)
                return ret;
 
index 526eac658ac5da5b382575b2d41c5e209cc3b997..d2e5e7c7cd1428dbeb1d0590e49157e3790ed346 100644 (file)
@@ -647,9 +647,8 @@ static int zynq_gem_probe(struct udevice *dev)
        priv->bus->read = zynq_gem_miiphy_read;
        priv->bus->write = zynq_gem_miiphy_write;
        priv->bus->priv = priv;
-       strcpy(priv->bus->name, "gem");
 
-       ret = mdio_register(priv->bus);
+       ret = mdio_register_seq(priv->bus, dev->seq);
        if (ret)
                return ret;