kernel: fix phy aneg crash

Fix a kernel crash caused when CONFIG_FIXED_PHY used for fixed phy drivers
in phy-add-aneg-done-function patch.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
openwrt-18.06
Tim Harvey 2017-03-09 16:04:38 -08:00 committed by Felix Fietkau
parent 11eac705c5
commit 08371a2db7
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@
{ {
int status; int status;
+ if (phydev->drv->update_link) + if (phydev->drv && phydev->drv->update_link)
+ return phydev->drv->update_link(phydev); + return phydev->drv->update_link(phydev);
+ +
/* Do a fake read */ /* Do a fake read */

View File

@ -19,7 +19,7 @@
{ {
int status; int status;
+ if (phydev->drv->update_link) + if (phydev->drv && phydev->drv->update_link)
+ return phydev->drv->update_link(phydev); + return phydev->drv->update_link(phydev);
+ +
/* Do a fake read */ /* Do a fake read */

View File

@ -19,7 +19,7 @@
{ {
int status; int status;
+ if (phydev->drv->update_link) + if (phydev->drv && phydev->drv->update_link)
+ return phydev->drv->update_link(phydev); + return phydev->drv->update_link(phydev);
+ +
/* Do a fake read */ /* Do a fake read */