Skip to content

Commit

Permalink
net: phy: Set the driver when registering an MDIO bus device
Browse files Browse the repository at this point in the history
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 <f.fainelli@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
ezequielgarcia authored and davem330 committed Jul 25, 2014
1 parent 042d765 commit a71e3c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/phy/mdio_bus.c
Expand Up @@ -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);

Expand Down

0 comments on commit a71e3c3

Please sign in to comment.