phy: Fix phy_id for Vitesse 824x PHY
authorKumar Gala <galak@kernel.crashing.org>
Thu, 28 Jun 2007 18:26:06 +0000 (13:26 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 28 Jun 2007 18:26:06 +0000 (13:26 -0500)
The phy_id specified for the Vitesse 824x PHY would never match because
it was expecting bits to be set that would be masked by the phy_id_mask.
Fix the phy_id so it will match properly, and changed the mdio_bus_match
to mask both the driver and devices phy_id with the mask so we dont have
this issue in the future.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/net/phy/mdio_bus.c
drivers/net/phy/vitesse.c

index fc4aee96cdfd87757d35786d19ddbd6211d1f8be..fc2f0e695a13a572a2309003243afe3ca685c6b1 100644 (file)
@@ -131,7 +131,8 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv)
        struct phy_device *phydev = to_phy_device(dev);
        struct phy_driver *phydrv = to_phy_driver(drv);
 
-       return (phydrv->phy_id == (phydev->phy_id & phydrv->phy_id_mask));
+       return ((phydrv->phy_id & phydrv->phy_id_mask) ==
+               (phydev->phy_id & phydrv->phy_id_mask));
 }
 
 /* Suspend and resume.  Copied from platform_suspend and
index 792716beb052ad44b143dbb253375ebdb706b566..596222b260d6cbec279d124b9a1701041125c3ca 100644 (file)
@@ -84,7 +84,7 @@ static int vsc824x_config_intr(struct phy_device *phydev)
 
 /* Vitesse 824x */
 static struct phy_driver vsc8244_driver = {
-       .phy_id         = 0x000fc6c2,
+       .phy_id         = 0x000fc6c0,
        .name           = "Vitesse VSC8244",
        .phy_id_mask    = 0x000fffc0,
        .features       = PHY_GBIT_FEATURES,