[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFcVECLucW=OXRnr1vVws2fswp0zHxBnMT-3JC2AOPXCLhDL1g@mail.gmail.com>
Date: Wed, 4 Sep 2019 19:41:03 +0530
From: Harini Katakam <harinik@...inx.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Harini Katakam <harini.katakam@...inx.com>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
David Miller <davem@...emloft.net>,
Michal Simek <michal.simek@...inx.com>, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
radhey.shyam.pandey@...inx.com
Subject: Re: [PATCH 2/2] net: gmii2rgmii: Switch priv field in mdio device structure
Hi Andrew,
On Tue, Aug 13, 2019 at 9:40 PM Andrew Lunn <andrew@...n.ch> wrote:
>
> > > 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)?
> >
> > Maybe phydev_mdio_get_drvdata? Because the driver data member available is
> > phydev->mdio.dev.driver_data.
>
> I still prefer phydev_get_drvdata(). It fits with the X_get_drvdata()
> pattern, where X is the type of parameter passed to the call, spi,
> pci, hci.
>
> We can also add mdiodev_get_drvdata(mdiodev). A few DSA drivers could
> use that.
Sorry for the late reply. I just sent a v2 adding
mdiodev_get/set_drvdata helpers
and using them in gmii2rgmii driver.
I did not add a corresponding phydev helper because there is no "struct dev" in
"struct phy_device" and I dint know if there were any users to add the member
and then a helper for driver data. Also,
strutct phy_device { struct mdio_device { struct device }}
is already available and it seemed logical to use that field to
set/get driver data
for gmii2rgmii. Please let me know if v2 is okay.
Regards,
Harini
Powered by blists - more mailing lists