]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd2b8530f154fb5e33e3cbbaa2e9ce786a66a48a8
tree43a7a6710ae8f81ef525389a659d9bfeecf571ad
parent4a91b9de3cf81e89db18372ebcfd3a53410841fc
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