Skip to content

Commit 197f9ab

Browse files
paulkocialkowskidavem330
authored andcommitted
net: phy: xgmiitorgmii: Support generic PHY status read
Some PHY drivers like the generic one do not provide a read_status callback on their own but rely on genphy_read_status being called directly. With the current code, this results in a NULL function pointer call. Call genphy_read_status instead when there is no specific callback. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4974d5f commit 197f9ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/phy/xilinx_gmii2rgmii.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev)
4444
u16 val = 0;
4545
int err;
4646

47-
err = priv->phy_drv->read_status(phydev);
47+
if (priv->phy_drv->read_status)
48+
err = priv->phy_drv->read_status(phydev);
49+
else
50+
err = genphy_read_status(phydev);
4851
if (err < 0)
4952
return err;
5053

0 commit comments

Comments
 (0)