mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: richardcochran@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	andrew@lunn.ch, f.fainelli@gmail.com, linux@arm.linux.org.uk
Subject: Re: [PATCH net-next] net: phylink: Remove redundant netdev.phydev assignment
Date: Thu, 01 Mar 2018 13:26:41 -0500 (EST)	[thread overview]
Message-ID: <20180301.132641.1222578145578661853.davem@davemloft.net> (raw)
In-Reply-To: <20180223152546.13354-1-richardcochran@gmail.com>

From: Richard Cochran <richardcochran@gmail.com>
Date: Fri, 23 Feb 2018 07:25:46 -0800

> As a part of working on MII time stamping infrastructure, I was trying
> to figure out how netdev->phydev gets assigned, and I stumbled across
> this.  Ever since the new phylink code came in, the field is assigned
> twice.
> 
> The function, phylink_connect_phy(), calls
> 
> 	phy_attach_direct()
> 	phylink_bringup_phy()
> 
> and phy_attach_direct() sets
> 
> 	dev->phydev = phydev;
> 
> but phylink_bringup_phy() then sets the same field again:
> 
> 	pl->netdev->phydev = phy;
> 
> Similarly, the function, phylink_of_phy_connect(), calls
> 
> 	of_phy_attach()
> 		phy_attach_direct()
> 	phylink_bringup_phy()
> 
> The removal code is also duplicated:
> 
> phylink_disconnect_phy()
> 	pl->netdev->phydev = NULL;
> 	phy_disconnect()
> 		phy_detach()
> 			phydev->attached_dev->phydev = NULL;
> 
> This patch removes the redundant assignments, restricting manipulation
> of the netdev.phydev field to phy_attach_direct() and phy_detach().
> 
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>

Applied, thanks Richard.
 

      reply	other threads:[~2018-03-01 18:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 15:25 Richard Cochran
2018-03-01 18:26 ` David Miller [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=20180301.132641.1222578145578661853.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@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

all inboxes | Powered by JetHome®