[LEDE-DEV] [PATCH 1/2] generic: ar8216: fix ar8xxx_is_possible check
Christian Lamparter
chunkeey at googlemail.com
Sat Oct 1 09:33:58 PDT 2016
The commit "generic: ar8216: add sanity check to ar8216_probe"
(774da6c7a40320a320b28d71291c0e61fcf7bc8a) stated that PHY IDs
should be checked at address 0-4. However, the PHY 4 was
never check by the for loop... And I can't find any documents
about why this check should be performed the way it is
currently?!
Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
.../linux/generic/files/drivers/net/phy/ar8216.c | 23 ----------------------
1 file changed, 23 deletions(-)
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 70f4774..57130b1 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -2110,26 +2110,6 @@ ar8xxx_phy_match(u32 phy_id)
return false;
}
-static bool
-ar8xxx_is_possible(struct mii_bus *bus)
-{
- unsigned i;
-
- for (i = 0; i < 4; i++) {
- u32 phy_id;
-
- phy_id = mdiobus_read(bus, i, MII_PHYSID1) << 16;
- phy_id |= mdiobus_read(bus, i, MII_PHYSID2);
- if (!ar8xxx_phy_match(phy_id)) {
- pr_debug("ar8xxx: unknown PHY at %s:%02x id:%08x\n",
- dev_name(&bus->dev), i, phy_id);
- return false;
- }
- }
-
- return true;
-}
-
static int
ar8xxx_phy_probe(struct phy_device *phydev)
{
@@ -2141,9 +2121,6 @@ ar8xxx_phy_probe(struct phy_device *phydev)
if (phydev->addr != 0 && phydev->addr != 4)
return -ENODEV;
- if (!ar8xxx_is_possible(phydev->bus))
- return -ENODEV;
-
mutex_lock(&ar8xxx_dev_list_lock);
list_for_each_entry(priv, &ar8xxx_dev_list, list)
if (priv->mii_bus == phydev->bus)
--
2.9.3
More information about the Lede-dev
mailing list