History

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.

Bartosz Golaszewski committed 6 years ago

Commit 8b11c201 parent bd8ff6d3 files · +21 −14Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/phy.h+2−13
@@ -322,20 +322,9 @@ static inline struct mii_bus *mdiobus_alloc(void) · 321 unmodified lines
322}322}
323 323
324int __mdiobus_register(struct mii_bus *bus, struct module *owner);324int __mdiobus_register(struct mii_bus *bus, struct module *owner);
325int __devm_mdiobus_register(struct mii_bus *bus, struct module *owner);
325#define mdiobus_register(bus) __mdiobus_register(bus, THIS_MODULE)326#define mdiobus_register(bus) __mdiobus_register(bus, THIS_MODULE)
326static inline int devm_mdiobus_register(struct mii_bus *bus)327#define devm_mdiobus_register(bus) __devm_mdiobus_register(bus, THIS_MODULE)
327{
328 int ret;
329
330 if (!bus->is_managed)
331 return -EPERM;
332
333 ret = mdiobus_register(bus);
334 if (!ret)
335 bus->is_managed_registered = 1;
336
337 return ret;
338}
339 328
340void mdiobus_unregister(struct mii_bus *bus);329void mdiobus_unregister(struct mii_bus *bus);
341void mdiobus_free(struct mii_bus *bus);330void mdiobus_free(struct mii_bus *bus);