mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-28 23:23:59 +00:00
generic: ar8216: unregister switch on error path
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35496
This commit is contained in:
parent
1bb8ad6050
commit
2e7f38c243
@ -1864,7 +1864,7 @@ ar8216_config_init(struct phy_device *pdev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err_free_priv;
|
goto err_free_priv;
|
||||||
|
|
||||||
ret = register_switch(&priv->dev, pdev->attached_dev);
|
ret = register_switch(swdev, pdev->attached_dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_cleanup_mib;
|
goto err_cleanup_mib;
|
||||||
|
|
||||||
@ -1875,11 +1875,11 @@ ar8216_config_init(struct phy_device *pdev)
|
|||||||
|
|
||||||
ret = priv->chip->hw_init(priv);
|
ret = priv->chip->hw_init(priv);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_cleanup_mib;
|
goto err_unregister_switch;
|
||||||
|
|
||||||
ret = ar8216_sw_reset_switch(&priv->dev);
|
ret = ar8216_sw_reset_switch(&priv->dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_cleanup_mib;
|
goto err_unregister_switch;
|
||||||
|
|
||||||
dev->phy_ptr = priv;
|
dev->phy_ptr = priv;
|
||||||
|
|
||||||
@ -1896,6 +1896,8 @@ ar8216_config_init(struct phy_device *pdev)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
err_unregister_switch:
|
||||||
|
unregister_switch(&priv->dev);
|
||||||
err_cleanup_mib:
|
err_cleanup_mib:
|
||||||
ar8xxx_mib_cleanup(priv);
|
ar8xxx_mib_cleanup(priv);
|
||||||
err_free_priv:
|
err_free_priv:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user