Commit 8b11c20a authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by David S. Miller

phy: un-inline devm_mdiobus_register()

Functions should only be static inline if they're very short. This
devres helper is already over 10 lines and it will grow soon as we'll
be improving upon its approach. Pull it into mdio_devres.c.
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bd8ff6de
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
libphy-y := phy.o phy-c45.o phy-core.o phy_device.o \ libphy-y := phy.o phy-c45.o phy-core.o phy_device.o \
linkmode.o linkmode.o
mdio-bus-y += mdio_bus.o mdio_device.o mdio-bus-y += mdio_bus.o mdio_device.o mdio_devres.o
ifdef CONFIG_MDIO_DEVICE ifdef CONFIG_MDIO_DEVICE
obj-y += mdio-boardinfo.o obj-y += mdio-boardinfo.o
......
// SPDX-License-Identifier: GPL-2.0-or-later
#include <linux/phy.h>
int __devm_mdiobus_register(struct mii_bus *bus, struct module *owner)
{
int ret;
if (!bus->is_managed)
return -EPERM;
ret = __mdiobus_register(bus, owner);
if (!ret)
bus->is_managed_registered = 1;
return ret;
}
EXPORT_SYMBOL(__devm_mdiobus_register);
...@@ -322,20 +322,9 @@ static inline struct mii_bus *mdiobus_alloc(void) ...@@ -322,20 +322,9 @@ static inline struct mii_bus *mdiobus_alloc(void)
} }
int __mdiobus_register(struct mii_bus *bus, struct module *owner); int __mdiobus_register(struct mii_bus *bus, struct module *owner);
int __devm_mdiobus_register(struct mii_bus *bus, struct module *owner);
#define mdiobus_register(bus) __mdiobus_register(bus, THIS_MODULE) #define mdiobus_register(bus) __mdiobus_register(bus, THIS_MODULE)
static inline int devm_mdiobus_register(struct mii_bus *bus) #define devm_mdiobus_register(bus) __devm_mdiobus_register(bus, THIS_MODULE)
{
int ret;
if (!bus->is_managed)
return -EPERM;
ret = mdiobus_register(bus);
if (!ret)
bus->is_managed_registered = 1;
return ret;
}
void mdiobus_unregister(struct mii_bus *bus); void mdiobus_unregister(struct mii_bus *bus);
void mdiobus_free(struct mii_bus *bus); void mdiobus_free(struct mii_bus *bus);
......
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