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
322322 }
323323
324324 int __mdiobus_register(struct mii_bus *bus, struct module *owner);
325+int __devm_mdiobus_register(struct mii_bus *bus, struct module *owner);
325326 #define mdiobus_register(bus) __mdiobus_register(bus, THIS_MODULE)
326−static inline int devm_mdiobus_register(struct mii_bus *bus)
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−}
327+#define devm_mdiobus_register(bus) __devm_mdiobus_register(bus, THIS_MODULE)
339328
340329 void mdiobus_unregister(struct mii_bus *bus);
341330 void mdiobus_free(struct mii_bus *bus);