projects
/
openwrt
/
svn-archive
/
archive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a8cc0aa
)
generic: ar8216: simplify ar8216_config_init
author
Gabor Juhos
<juhosg@openwrt.org>
Thu, 8 Mar 2012 10:21:08 +0000
(10:21 +0000)
committer
Gabor Juhos
<juhosg@openwrt.org>
Thu, 8 Mar 2012 10:21:08 +0000
(10:21 +0000)
SVN-Revision: 30853
target/linux/generic/files/drivers/net/phy/ar8216.c
patch
|
blob
|
history
diff --git
a/target/linux/generic/files/drivers/net/phy/ar8216.c
b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 3b7937d72b58b6cb499c2590d1222d8ca5737269..8e84e9d70a143fdc70d05709f9f5459a4f3a4944 100644
(file)
--- a/
target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/
target/linux/generic/files/drivers/net/phy/ar8216.c
@@
-892,34
+892,24
@@
ar8216_config_init(struct phy_device *pdev)
swdev->vlans = AR8216_NUM_VLANS;
}
swdev->vlans = AR8216_NUM_VLANS;
}
- if ((ret = register_switch(&priv->dev, pdev->attached_dev)) < 0) {
- kfree(priv);
- goto done;
- }
+ ret = register_switch(&priv->dev, pdev->attached_dev);
+ if (ret)
+ goto err_free_priv;
priv->init = true;
priv->init = true;
- if (priv->chip == AR8316) {
+ ret = 0;
+ if (priv->chip == AR8236)
+ ret = ar8236_hw_init(priv);
+ else if (priv->chip == AR8316)
ret = ar8316_hw_init(priv);
ret = ar8316_hw_init(priv);
- if (ret) {
- kfree(priv);
- goto done;
- }
- }
- if (priv->chip == AR8236) {
- ret = ar8236_hw_init(priv);
- if (ret) {
- kfree(priv);
- goto done;
- }
- }
+ if (ret)
+ goto err_free_priv;
ret = ar8216_reset_switch(&priv->dev);
ret = ar8216_reset_switch(&priv->dev);
- if (ret) {
- kfree(priv);
- goto done;
- }
+ if (ret)
+ goto err_free_priv;
dev->phy_ptr = priv;
dev->phy_ptr = priv;
@@
-936,7
+926,10
@@
ar8216_config_init(struct phy_device *pdev)
priv->init = false;
priv->init = false;
-done:
+ return 0;
+
+err_free_priv:
+ kfree(priv);
return ret;
}
return ret;
}