summaryrefslogtreecommitdiff
path: root/target/linux/generic
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-02-10 13:05:15 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-02-10 13:05:15 +0000
commit5ed480598d26b56906af2a2cbc6e83582faa0df3 (patch)
tree4423be6c98b13adb53a643fc366379efbe7bd05b /target/linux/generic
parent774da6c7a40320a320b28d71291c0e61fcf7bc8a (diff)
downloadmtk-20170518-5ed480598d26b56906af2a2cbc6e83582faa0df3.zip
mtk-20170518-5ed480598d26b56906af2a2cbc6e83582faa0df3.tar.gz
mtk-20170518-5ed480598d26b56906af2a2cbc6e83582faa0df3.tar.bz2
generic: ar8216: don't probe the chip multiple times
It is only needed when the private data is allocated. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 35538
Diffstat (limited to 'target/linux/generic')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index f356eaf..ec6d232 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -1780,17 +1780,17 @@ ar8216_config_init(struct phy_device *pdev)
priv = kzalloc(sizeof(struct ar8216_priv), GFP_KERNEL);
if (priv == NULL)
return -ENOMEM;
- }
- priv->mii_bus = pdev->bus;
- priv->read = ar8216_mii_read;
- priv->write = ar8216_mii_write;
+ priv->mii_bus = pdev->bus;
+ priv->read = ar8216_mii_read;
+ priv->write = ar8216_mii_write;
- priv->phy = pdev;
+ ret = ar8216_id_chip(priv);
+ if (ret)
+ goto err_free_priv;
+ }
- ret = ar8216_id_chip(priv);
- if (ret)
- goto err_free_priv;
+ priv->phy = pdev;
if (ar8xxx_has_gige(priv))
pdev->supported = SUPPORTED_1000baseT_Full;