lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f1706f95-8135-d8ec-c65f-edc7d2d63e5e@cogentembedded.com>
Date:	Mon, 18 Jul 2016 13:14:56 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Philippe Reynes <tremyfr@...il.com>, davem@...emloft.net,
	jszhang@...vell.com, mugunthanvnm@...com, a@...table.cc,
	fw@...len.de
Cc:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] net: ethernet: marvell: pxa168_eth: use phydev from
 struct net_device

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ