Revert "net: mdio: fix owner field for mdio buses registered using device-tree"

This reverts commit d04dac7fae.

It removes of_mdiobus_register() from the symbol list, which Android
drivers are using, and they don't care about module owners as kernel
modules are not allowed to be removed on Android systems, so revert it
to preserve the ABI.

Bug: 161946584
Change-Id: I5bb5d4261bab07c3a4eeb7a41ae09d4a41d56e7e
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2023-04-17 11:36:33 +00:00
parent f3670bd0ff
commit 0334ff98b9
3 changed files with 13 additions and 32 deletions

View File

@ -238,23 +238,21 @@ bool of_mdiobus_child_is_phy(struct device_node *child)
EXPORT_SYMBOL(of_mdiobus_child_is_phy);
/**
* __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
* @np: pointer to device_node of MDIO bus.
* @owner: module owning the @mdio object.
*
* This function registers the mii_bus structure and registers a phy_device
* for each child node of @np.
*/
int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
struct module *owner)
int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
{
struct device_node *child;
bool scanphys = false;
int addr, rc;
if (!np)
return __mdiobus_register(mdio, owner);
return mdiobus_register(mdio);
/* Do not continue if the node is disabled */
if (!of_device_is_available(np))
@ -274,7 +272,7 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
of_property_read_u32(np, "reset-post-delay-us", &mdio->reset_post_delay_us);
/* Register the MDIO bus */
rc = __mdiobus_register(mdio, owner);
rc = mdiobus_register(mdio);
if (rc)
return rc;
@ -338,7 +336,7 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
mdiobus_unregister(mdio);
return rc;
}
EXPORT_SYMBOL(__of_mdiobus_register);
EXPORT_SYMBOL(of_mdiobus_register);
/**
* of_mdio_find_device - Given a device tree node, find the mdio_device

View File

@ -98,14 +98,13 @@ EXPORT_SYMBOL(__devm_mdiobus_register);
#if IS_ENABLED(CONFIG_OF_MDIO)
/**
* __devm_of_mdiobus_register - Resource managed variant of of_mdiobus_register()
* devm_of_mdiobus_register - Resource managed variant of of_mdiobus_register()
* @dev: Device to register mii_bus for
* @mdio: MII bus structure to register
* @np: Device node to parse
* @owner: Owning module
*/
int __devm_of_mdiobus_register(struct device *dev, struct mii_bus *mdio,
struct device_node *np, struct module *owner)
int devm_of_mdiobus_register(struct device *dev, struct mii_bus *mdio,
struct device_node *np)
{
struct mdiobus_devres *dr;
int ret;
@ -118,7 +117,7 @@ int __devm_of_mdiobus_register(struct device *dev, struct mii_bus *mdio,
if (!dr)
return -ENOMEM;
ret = __of_mdiobus_register(mdio, np, owner);
ret = of_mdiobus_register(mdio, np);
if (ret) {
devres_free(dr);
return ret;
@ -128,7 +127,7 @@ int __devm_of_mdiobus_register(struct device *dev, struct mii_bus *mdio,
devres_add(dev, dr);
return 0;
}
EXPORT_SYMBOL(__devm_of_mdiobus_register);
EXPORT_SYMBOL(devm_of_mdiobus_register);
#endif /* CONFIG_OF_MDIO */
MODULE_LICENSE("GPL");

View File

@ -14,25 +14,9 @@
#if IS_ENABLED(CONFIG_OF_MDIO)
bool of_mdiobus_child_is_phy(struct device_node *child);
int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
struct module *owner);
static inline int of_mdiobus_register(struct mii_bus *mdio,
struct device_node *np)
{
return __of_mdiobus_register(mdio, np, THIS_MODULE);
}
int __devm_of_mdiobus_register(struct device *dev, struct mii_bus *mdio,
struct device_node *np, struct module *owner);
static inline int devm_of_mdiobus_register(struct device *dev,
struct mii_bus *mdio,
struct device_node *np)
{
return __devm_of_mdiobus_register(dev, mdio, np, THIS_MODULE);
}
int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np);
int devm_of_mdiobus_register(struct device *dev, struct mii_bus *mdio,
struct device_node *np);
struct mdio_device *of_mdio_find_device(struct device_node *np);
struct phy_device *of_phy_find_device(struct device_node *phy_np);
struct phy_device *