netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Philippe Reynes <tremyfr@gmail.com>,
	davem@davemloft.net, jszhang@marvell.com, mugunthanvnm@ti.com,
	a@unstable.cc, fw@strlen.de
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] net: ethernet: marvell: pxa168_eth: use phydev from struct net_device
Date: Mon, 18 Jul 2016 13:14:56 +0300	[thread overview]
Message-ID: <f1706f95-8135-d8ec-c65f-edc7d2d63e5e@cogentembedded.com> (raw)
In-Reply-To: <1468791046-19567-1-git-send-email-tremyfr@gmail.com>

Hello.

On 7/18/2016 12:30 AM, Philippe Reynes wrote:

> The private structure contain a pointer to phydev, but the structure
> net_device already contain such pointer. So we can remove the pointer
> phydev in the private structure, and update the driver to use the
> one contained in struct net_device.
>
> Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
> ---
>  drivers/net/ethernet/marvell/pxa168_eth.c |   36 +++++++++++++----------------
>  1 files changed, 16 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
> index 54d5154..d466326 100644
> --- a/drivers/net/ethernet/marvell/pxa168_eth.c
> +++ b/drivers/net/ethernet/marvell/pxa168_eth.c
[...]
> @@ -973,16 +972,17 @@ static int pxa168_init_phy(struct net_device *dev)
>  {
>  	struct pxa168_eth_private *pep = netdev_priv(dev);
>  	struct ethtool_cmd cmd;
> +	struct phy_device *phy = NULL;

   Initializer not really needed.

>  	int err;
>
> -	if (pep->phy)
> +	if (dev->phydev)
>  		return 0;
>
> -	pep->phy = mdiobus_scan(pep->smi_bus, pep->phy_addr);
> -	if (IS_ERR(pep->phy))
> -		return PTR_ERR(pep->phy);
> +	phy = mdiobus_scan(pep->smi_bus, pep->phy_addr);
> +	if (IS_ERR(phy))
> +		return PTR_ERR(phy);
>
> -	err = phy_connect_direct(dev, pep->phy, pxa168_eth_adjust_link,
> +	err = phy_connect_direct(dev, phy, pxa168_eth_adjust_link,
>  				 pep->phy_intf);
>  	if (err)
>  		return err;

    Hm, where do you assign 'dev->phydev'?

[...]

MBR, Sergei

  parent reply	other threads:[~2016-07-18 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-17 21:30 [PATCH 1/2] net: ethernet: marvell: pxa168_eth: use phydev from struct net_device Philippe Reynes
2016-07-17 21:30 ` [PATCH 2/2] net: ethernet: marvell: pxa168_eth: use phy_ethtool_{get|set}_link_ksettings Philippe Reynes
2016-07-18  6:23   ` David Miller
2016-07-18 22:02   ` Florian Fainelli
2016-07-18  6:22 ` [PATCH 1/2] net: ethernet: marvell: pxa168_eth: use phydev from struct net_device David Miller
2016-07-18 10:14 ` Sergei Shtylyov [this message]
2016-07-18 22:00   ` Philippe Reynes

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=f1706f95-8135-d8ec-c65f-edc7d2d63e5e@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=a@unstable.cc \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=jszhang@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=tremyfr@gmail.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).