Re: [PATCH] phylib: phy_attach_direct: phy_init_hw can fail, add cleanup
From: David Miller <davem@davemloft.net>
Date: 2011-03-30 09:31:50
From: David Miller <davem@davemloft.net>
Date: 2011-03-30 09:31:50
From: Marc Kleine-Budde <mkl@pengutronix.de> Date: Tue, 29 Mar 2011 02:54:08 +0200
The function phy_attach_direct attaches the phy and calls phy_init_hw. phy_init_hw can fail, but the phy is still marked as attached. Successive calls to phy_attach_direct will fail because the phy is busy.
...
This patch adds phy_detach to clean up if phy_init_hw fails. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Applied, thank you.