]> Git Repo - linux.git/commitdiff
net: phy: Set the driver when registering an MDIO bus device
authorEzequiel Garcia <[email protected]>
Wed, 23 Jul 2014 19:47:31 +0000 (16:47 -0300)
committerDavid S. Miller <[email protected]>
Fri, 25 Jul 2014 01:09:52 +0000 (18:09 -0700)
mdiobus_register() registers a device which is already bound to a driver.
Hence, the driver pointer should be set properly in order to track down
the driver associated to the MDIO bus.

This will be used to allow ethernet driver to pin down a MDIO bus driver,
preventing it from being unloaded while the PHY device is running.

Reviewed-by: Florian Fainelli <[email protected]>
Tested-by: Florian Fainelli <[email protected]>
Signed-off-by: Ezequiel Garcia <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/phy/mdio_bus.c

index 4eaadcfcb0fe5ed2d5bd82a4632989916ade90e2..203651ebccb0fa21e419a2956188658344ab9dab 100644 (file)
@@ -255,6 +255,7 @@ int mdiobus_register(struct mii_bus *bus)
 
        bus->dev.parent = bus->parent;
        bus->dev.class = &mdio_bus_class;
+       bus->dev.driver = bus->parent->driver;
        bus->dev.groups = NULL;
        dev_set_name(&bus->dev, "%s", bus->id);
 
This page took 0.05567 seconds and 4 git commands to generate.