Merge branch 'Fix-GMII2RGMII-private-field'

Harini Katakam says:

====================
Fix GMII2RGMII private field

Fix the usage of external phy's priv field by gmii2rgmii driver.

Based on net-next.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2019-09-05 12:32:06 +02:00
Родитель 1ddee6d843 168f7a1616
Коммит 1e6068899c
2 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -68,6 +68,17 @@ struct mdio_driver {
#define to_mdio_driver(d) \
container_of(to_mdio_common_driver(d), struct mdio_driver, mdiodrv)
/* device driver data */
static inline void mdiodev_set_drvdata(struct mdio_device *mdio, void *data)
{
dev_set_drvdata(&mdio->dev, data);
}
static inline void *mdiodev_get_drvdata(struct mdio_device *mdio)
{
return dev_get_drvdata(&mdio->dev);
}
void mdio_device_free(struct mdio_device *mdiodev);
struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);
int mdio_device_register(struct mdio_device *mdiodev);