Commit 3e64db35 authored by Jakub Kicinski's avatar Jakub Kicinski

Revert "net: mdio: get/put device node during (un)registration"

This reverts commit cff9c565.

Revert based on feedback from Russell.

Link: https://lore.kernel.org/all/ZZPtUIRerqTI2%2Fyh@shell.armlinux.org.uk/Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 1e71017b
...@@ -139,11 +139,6 @@ bool of_mdiobus_child_is_phy(struct device_node *child) ...@@ -139,11 +139,6 @@ bool of_mdiobus_child_is_phy(struct device_node *child)
} }
EXPORT_SYMBOL(of_mdiobus_child_is_phy); EXPORT_SYMBOL(of_mdiobus_child_is_phy);
static void __of_mdiobus_unregister_callback(struct mii_bus *mdio)
{
of_node_put(mdio->dev.of_node);
}
/** /**
* __of_mdiobus_register - Register mii_bus and create PHYs from the device tree * __of_mdiobus_register - Register mii_bus and create PHYs from the device tree
* @mdio: pointer to mii_bus structure * @mdio: pointer to mii_bus structure
...@@ -171,8 +166,6 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np, ...@@ -171,8 +166,6 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
* the device tree are populated after the bus has been registered */ * the device tree are populated after the bus has been registered */
mdio->phy_mask = ~0; mdio->phy_mask = ~0;
mdio->__unregister_callback = __of_mdiobus_unregister_callback;
of_node_get(np);
device_set_node(&mdio->dev, of_fwnode_handle(np)); device_set_node(&mdio->dev, of_fwnode_handle(np));
/* Get bus level PHY reset GPIO details */ /* Get bus level PHY reset GPIO details */
...@@ -184,7 +177,7 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np, ...@@ -184,7 +177,7 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
/* Register the MDIO bus */ /* Register the MDIO bus */
rc = __mdiobus_register(mdio, owner); rc = __mdiobus_register(mdio, owner);
if (rc) if (rc)
goto put_node; return rc;
/* Loop over the child nodes and register a phy_device for each phy */ /* Loop over the child nodes and register a phy_device for each phy */
for_each_available_child_of_node(np, child) { for_each_available_child_of_node(np, child) {
...@@ -244,9 +237,6 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np, ...@@ -244,9 +237,6 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
unregister: unregister:
of_node_put(child); of_node_put(child);
mdiobus_unregister(mdio); mdiobus_unregister(mdio);
put_node:
of_node_put(np);
return rc; return rc;
} }
EXPORT_SYMBOL(__of_mdiobus_register); EXPORT_SYMBOL(__of_mdiobus_register);
......
...@@ -787,9 +787,6 @@ void mdiobus_unregister(struct mii_bus *bus) ...@@ -787,9 +787,6 @@ void mdiobus_unregister(struct mii_bus *bus)
gpiod_set_value_cansleep(bus->reset_gpiod, 1); gpiod_set_value_cansleep(bus->reset_gpiod, 1);
device_del(&bus->dev); device_del(&bus->dev);
if (bus->__unregister_callback)
bus->__unregister_callback(bus);
} }
EXPORT_SYMBOL(mdiobus_unregister); EXPORT_SYMBOL(mdiobus_unregister);
......
...@@ -434,9 +434,6 @@ struct mii_bus { ...@@ -434,9 +434,6 @@ struct mii_bus {
/** @shared: shared state across different PHYs */ /** @shared: shared state across different PHYs */
struct phy_package_shared *shared[PHY_MAX_ADDR]; struct phy_package_shared *shared[PHY_MAX_ADDR];
/** @__unregister_callback: called at the last step of unregistration */
void (*__unregister_callback)(struct mii_bus *bus);
}; };
#define to_mii_bus(d) container_of(d, struct mii_bus, dev) #define to_mii_bus(d) container_of(d, struct mii_bus, dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment