From 4f1be06df2b798822c34f8fcc8ef71991dfe5659 Mon Sep 17 00:00:00 2001 From: David Daney Date: Wed, 27 Jun 2012 07:33:37 +0000 Subject: [PATCH] --- yaml --- r: 314687 b: refs/heads/master c: a30e2c1891296b5ee8de48430a07fdf8b818c661 h: refs/heads/master i: 314685: 1bf5d5d924975d4b01263249a2354fa6678ca06a 314683: 899805a638937d2ed715a1a7fca5dc1991b2c64e 314679: ed65172097a68ac5f5a3c85869f4e582c9b84f04 314671: 20d6faebadd64c699dc37f7a269109616868395d 314655: 331bd2566da56c27abb9a8b77a46e96fdcf8c1ee 314623: 6498535608260fbd1777a21e6acac17b05abfbec v: v3 --- [refs] | 2 +- trunk/drivers/net/phy/mdio_bus.c | 7 +++++++ trunk/include/linux/phy.h | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index be6405fa739e..bb2666c64c94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6bd47ac2e434611e52027155438d7b4ad3c76bdb +refs/heads/master: a30e2c1891296b5ee8de48430a07fdf8b818c661 diff --git a/trunk/drivers/net/phy/mdio_bus.c b/trunk/drivers/net/phy/mdio_bus.c index 2cee6d218d21..170eb411ab5d 100644 --- a/trunk/drivers/net/phy/mdio_bus.c +++ b/trunk/drivers/net/phy/mdio_bus.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -308,6 +309,12 @@ 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); + if (of_driver_match_device(dev, drv)) + return 1; + + if (phydrv->match_phy_device) + return phydrv->match_phy_device(phydev); + return ((phydrv->phy_id & phydrv->phy_id_mask) == (phydev->phy_id & phydrv->phy_id_mask)); } diff --git a/trunk/include/linux/phy.h b/trunk/include/linux/phy.h index 597d05dd0fb4..7eac80a2557b 100644 --- a/trunk/include/linux/phy.h +++ b/trunk/include/linux/phy.h @@ -426,6 +426,12 @@ struct phy_driver { /* Clears up any memory if needed */ void (*remove)(struct phy_device *phydev); + /* Returns true if this is a suitable driver for the given + * phydev. If NULL, matching is based on phy_id and + * phy_id_mask. + */ + int (*match_phy_device)(struct phy_device *phydev); + /* Handles ethtool queries for hardware time stamping. */ int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti);