aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-02-05 08:39:24 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-02-05 08:39:24 +0000
commit2e7f38c243030724f91a3b9672c28b66c0a7c16f (patch)
tree57c5952a2aadf05f29e78a0c23ef160d5ba96daa
parent1bb8ad60509945794674b550102427c8c77a9d88 (diff)
downloadupstream-2e7f38c243030724f91a3b9672c28b66c0a7c16f.tar.gz
upstream-2e7f38c243030724f91a3b9672c28b66c0a7c16f.tar.bz2
upstream-2e7f38c243030724f91a3b9672c28b66c0a7c16f.zip
generic: ar8216: unregister switch on error path
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35496
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index b274b13662..3a0483ddba 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1125,7 +1125,7 @@ ar8327_init_port(struct ar8216_priv *priv, int port)
cfg = NULL;
ar8327_config_port(priv, port, cfg);
-
+
priv->write(priv, AR8327_REG_PORT_HEADER(port), 0);
t = 1 << AR8327_PORT_VLAN0_DEF_SVID_S;
@@ -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: