net: macb: Probe MDIO bus before registering netdev
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 3 May 2016 01:38:45 +0000 (18:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 May 2016 20:06:05 +0000 (16:06 -0400)
commitcf6696608a069aaac10a253207deeb63dcd6a653
tree43a7a6710ae8f81ef525389a659d9bfeecf571ad
parentb365d955f3f8dad71845fee8092330039f67c428
net: macb: Probe MDIO bus before registering netdev

The current sequence makes us register for a network device prior to
registering and probing the MDIO bus which could lead to some unwanted
consequences, like a thread of execution calling into ndo_open before
register_netdev() returns, while the MDIO bus is not ready yet.

Rework the sequence to register for the MDIO bus, and therefore attach
to a PHY prior to calling register_netdev(), which implies reworking the
error path a bit.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb.c