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: Bartosz Golaszewski <bgolaszewski@baylibre.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
bd8ff6de0c
commit
8b11c20a65
@@ -3,7 +3,7 @@
|
||||
|
||||
libphy-y := phy.o phy-c45.o phy-core.o phy_device.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
|
||||
obj-y += mdio-boardinfo.o
|
||||
|
18
drivers/net/phy/mdio_devres.c
Normal file
18
drivers/net/phy/mdio_devres.c
Normal file
@@ -0,0 +1,18 @@
|
||||
// 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);
|
Reference in New Issue
Block a user