mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
of: mdio: Fall back to mdiobus_register() with NULL device_node
When the device_node specified is NULL, fall back to mdiobus_register(). We have a number of drivers having a similar pattern which is: if (np) of_mdiobus_register() else mdiobus_register() so incorporate that behavior within the core of_mdiobus_register() function. This is also consistent with the stub version that we defined when CONFIG_OF=n. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c6213eb1ae
commit
6d07a68a59
1 changed files with 3 additions and 0 deletions
|
@ -204,6 +204,9 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
|
||||||
bool scanphys = false;
|
bool scanphys = false;
|
||||||
int addr, rc;
|
int addr, rc;
|
||||||
|
|
||||||
|
if (!np)
|
||||||
|
return mdiobus_register(mdio);
|
||||||
|
|
||||||
/* Do not continue if the node is disabled */
|
/* Do not continue if the node is disabled */
|
||||||
if (!of_device_is_available(np))
|
if (!of_device_is_available(np))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
Loading…
Reference in a new issue