linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harini Katakam <harinik@xilinx.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Harini Katakam <harini.katakam@xilinx.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	David Miller <davem@davemloft.net>,
	Michal Simek <michal.simek@xilinx.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, radhey.shyam.pandey@xilinx.com
Subject: Re: [PATCH 2/2] net: gmii2rgmii: Switch priv field in mdio device structure
Date: Wed, 4 Sep 2019 19:41:03 +0530	[thread overview]
Message-ID: <CAFcVECLucW=OXRnr1vVws2fswp0zHxBnMT-3JC2AOPXCLhDL1g@mail.gmail.com> (raw)
In-Reply-To: <20190813153820.GY14290@lunn.ch>

Hi Andrew,

On Tue, Aug 13, 2019 at 9:40 PM Andrew Lunn <andrew@lunn.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

      reply	other threads:[~2019-09-04 14:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31  9:36 [PATCH 0/2] Fix GMII2RGMII private field Harini Katakam
2019-07-31  9:36 ` [PATCH 1/2] include: mdio: Add private field to mdio structure Harini Katakam
2019-07-31  9:36 ` [PATCH 2/2] net: gmii2rgmii: Switch priv field in mdio device structure Harini Katakam
2019-08-01  4:06   ` Andrew Lunn
2019-08-13 11:16     ` Harini Katakam
2019-08-13 13:23       ` Andrew Lunn
2019-08-13 15:13         ` Harini Katakam
2019-08-13 15:38           ` Andrew Lunn
2019-09-04 14:11             ` Harini Katakam [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFcVECLucW=OXRnr1vVws2fswp0zHxBnMT-3JC2AOPXCLhDL1g@mail.gmail.com' \
    --to=harinik@xilinx.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=harini.katakam@xilinx.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=radhey.shyam.pandey@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).