sh_eth: call of_mdiobus_register() to register phys
Quoted 40 lines · Ben Dooks
Quoted 39 lines · Sergei Shtylyov
Hello.
Quoted 9 lines · Ben Dooks
If the
sh_ethdevice is registered using OF, then the driver should callof_mdiobus_register()to register any PHYs connected to the system.Signed-off-by Ben Dooks <[email protected]>--
v2:
- allocatemdio->irqarray at init timeDid this also fix something?
Quoted 23 lines
- set devdata after succesful mdio registration
--- drivers/net/ethernet/renesas/sh_eth.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)drivers/net/ethernet/renesas/sh_eth.c +1
-0@@ -40,6 +40,7 @@#include <linux/if_vlan.h> #include <linux/clk.h> #include <linux/sh_eth.h> +#include <linux/of_mdio.h> #include "sh_eth.h" @@ -2638,6 +2639,18 @@ static int sh_mdio_init(struct net_device *ndev, int id, goto out_free_bus; }
Quoted 6 lines
Quoted 6 lines
drivers/net/ethernet/renesas/sh_eth.c static int sh_mdio_init(struct net_device · line 2646
Quoted 4 lines
drivers/net/ethernet/renesas/sh_eth.c +4
-0+if (ndev->dev.parent->of_node) { + ret =of_mdiobus_register (mdp->mii_bus, + ndev->dev.parent->of_node); +if (ret !=0 ) {Why not just (ret)?
Because of years of people complaining that an integer is not a boolean. I'll change that in the next version of the patch.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius