From: Gabor Juhos Date: Sun, 10 Feb 2013 13:05:15 +0000 (+0000) Subject: generic: ar8216: don't probe the chip multiple times X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5ed480598d26b56906af2a2cbc6e83582faa0df3;p=openwrt%2Fstaging%2Frobimarko.git generic: ar8216: don't probe the chip multiple times It is only needed when the private data is allocated. Signed-off-by: Gabor Juhos SVN-Revision: 35538 --- diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index f356eafe5d..ec6d232668 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;