Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Florian Fainelli and committed by
David S. Miller
6d07a68a c6213eb1

+3
+3
drivers/of/of_mdio.c
··· 204 204 bool scanphys = false; 205 205 int addr, rc; 206 206 207 + if (!np) 208 + return mdiobus_register(mdio); 209 + 207 210 /* Do not continue if the node is disabled */ 208 211 if (!of_device_is_available(np)) 209 212 return -ENODEV;