summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-02-10 13:05:15 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-02-10 13:05:15 +0000
commit03715e59dbcfa4249552f291f2e64557b7ccc0ce (patch)
treedbc4e3f9dd249896b2908e99241376338527372e /target/linux/generic/files
parenta1483517cd0daff3e27624ce227840562ee89ab6 (diff)
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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35538 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files')
-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 f356eafe5..ec6d23266 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;