-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Bartosz Golaszewski
authored and
David S. Miller
committed
Jun 30, 2020
1 parent
bd8ff6d
commit 8b11c20
Showing
3 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters