lkml.org 
[lkml]   [2019]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/2] net: gmii2rgmii: Switch priv field in mdio device structure
    On Tue, Aug 13, 2019 at 04:46:40PM +0530, Harini Katakam wrote:
    > Hi Andrew,
    >
    > On Thu, Aug 1, 2019 at 9:36 AM Andrew Lunn <andrew@lunn.ch> wrote:
    > >
    > > On Wed, Jul 31, 2019 at 03:06:19PM +0530, Harini Katakam wrote:
    > > > Use the priv field in mdio device structure instead of the one in
    > > > phy device structure. The phy device priv field may be used by the
    > > > external phy driver and should not be overwritten.
    > >
    > > Hi Harini
    > >
    > > I _think_ you could use dev_set_drvdata(&mdiodev->dev) in xgmiitorgmii_probe() and
    > > dev_get_drvdata(&phydev->mdiomdio.dev) in _read_status()
    >
    > Thanks for the review. This works if I do:
    > dev_set_drvdata(&priv->phy_dev->mdio.dev->dev) in probe
    > and then
    > dev_get_drvdata(&phydev->mdio.dev) in _read_status()
    >
    > i.e mdiodev in gmii2rgmii probe and priv->phy_dev->mdio are not the same.
    >
    > If this is acceptable, I can send a v2.

    Hi Harini

    I think this is better, making use of the central driver
    infrastructure, rather than inventing something new.

    The kernel does have a few helper, spi_get_drvdata, pci_get_drvdata,
    hci_get_drvdata. So maybe had add phydev_get_drvdata(struct phy_device
    *phydev)?

    Thanks
    Andrew

    \
     
     \ /
      Last update: 2019-08-13 15:23    [W:2.241 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site