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.
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -322,20 +322,9 @@ static inline struct mii_bus *mdiobus_alloc(void) · 321 unmodified lines | |||
| 322 | } | 322 | } |
| 323 | 323 | ||
| 324 | int __mdiobus_register(struct mii_bus *bus, struct module *owner); | 324 | int __mdiobus_register(struct mii_bus *bus, struct module *owner); |
| 325 | int __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) |
| 326 | static 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 | ||
| 340 | void mdiobus_unregister(struct mii_bus *bus); | 329 | void mdiobus_unregister(struct mii_bus *bus); |
| 341 | void mdiobus_free(struct mii_bus *bus); | 330 | void mdiobus_free(struct mii_bus *bus); |