diff options
Diffstat (limited to 'drivers/net/phy/phy-core.c')
-rw-r--r-- | drivers/net/phy/phy-core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index ab52de35b5..b12f54ed38 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -27,6 +27,11 @@ static int phy_read_page(struct phy_device *phydev) { struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); + if (!phydrv->read_page) { + dev_warn_once(&phydev->dev, "read_page callback not available, PHY driver not loaded?\n"); + return -EOPNOTSUPP; + } + return phydrv->read_page(phydev); } @@ -34,6 +39,11 @@ static int phy_write_page(struct phy_device *phydev, int page) { struct phy_driver *phydrv = to_phy_driver(phydev->dev.driver); + if (!phydrv->write_page) { + dev_warn_once(&phydev->dev, "write_page callback not available, PHY driver not loaded?\n"); + return -EOPNOTSUPP; + } + return phydrv->write_page(phydev, page); } |