summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarini Katakam <harini.katakam@xilinx.com>2019-09-04 19:30:21 +0530
committerDavid S. Miller <davem@davemloft.net>2019-09-05 12:32:06 +0200
commit168f7a1616081832bcfd710c2b5eaeb848eacebb (patch)
tree945368660310b564a4ae72fde8229ef01fae97ab
parent36b1a2fcd0d263cec3d1a896386611195329af84 (diff)
net: phy: gmii2rgmii: Dont use priv field in phy device
Use set/get drv data in phydev's mdio device instead. Phy device priv field maybe used by the external phy driver and should not be overwritten. Signed-off-by: Harini Katakam <harini.katakam@xilinx.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/xilinx_gmii2rgmii.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 2d1449345959..151c2a3f0b3a 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -29,7 +29,7 @@ struct gmii2rgmii {
static int xgmiitorgmii_read_status(struct phy_device *phydev)
{
- struct gmii2rgmii *priv = phydev->priv;
+ struct gmii2rgmii *priv = mdiodev_get_drvdata(&phydev->mdio);
struct mii_bus *bus = priv->mdio->bus;
int addr = priv->mdio->addr;
u16 val = 0;
@@ -90,7 +90,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)
memcpy(&priv->conv_phy_drv, priv->phy_dev->drv,
sizeof(struct phy_driver));
priv->conv_phy_drv.read_status = xgmiitorgmii_read_status;
- priv->phy_dev->priv = priv;
+ mdiodev_set_drvdata(&priv->phy_dev->mdio, priv);
priv->phy_dev->drv = &priv->conv_phy_drv;
return 0;