generic: ar8216: unregister switch on error path

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35496 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Gabor Juhos 2013-02-05 08:39:24 +00:00
parent 81da03e0d1
commit 708c4a4f33
1 changed files with 6 additions and 4 deletions

View File

@ -1864,7 +1864,7 @@ ar8216_config_init(struct phy_device *pdev)
if (ret)
goto err_free_priv;
ret = register_switch(&priv->dev, pdev->attached_dev);
ret = register_switch(swdev, pdev->attached_dev);
if (ret)
goto err_cleanup_mib;
@ -1875,11 +1875,11 @@ ar8216_config_init(struct phy_device *pdev)
ret = priv->chip->hw_init(priv);
if (ret)
goto err_cleanup_mib;
goto err_unregister_switch;
ret = ar8216_sw_reset_switch(&priv->dev);
if (ret)
goto err_cleanup_mib;
goto err_unregister_switch;
dev->phy_ptr = priv;
@ -1896,6 +1896,8 @@ ar8216_config_init(struct phy_device *pdev)
return 0;
err_unregister_switch:
unregister_switch(&priv->dev);
err_cleanup_mib:
ar8xxx_mib_cleanup(priv);
err_free_priv: