[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <578D520F.9000209@gmail.com>
Date: Mon, 18 Jul 2016 15:02:55 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Philippe Reynes <tremyfr@...il.com>, davem@...emloft.net,
jszhang@...vell.com, sergei.shtylyov@...entembedded.com,
mugunthanvnm@...com, a@...table.cc, fw@...len.de
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] net: ethernet: marvell: pxa168_eth: use
phy_ethtool_{get|set}_link_ksettings
On 07/17/2016 02:30 PM, Philippe Reynes wrote:
> There are two generics functions phy_ethtool_{get|set}_link_ksettings,
> so we can use them instead of defining the same code in the driver.
>
> Signed-off-by: Philippe Reynes <tremyfr@...il.com>
> ---
> - cmd.phy_address = pep->phy_addr;
> - cmd.speed = pep->phy_speed;
> - cmd.duplex = pep->phy_duplex;
> - cmd.advertising = PHY_BASIC_FEATURES;
> - cmd.autoneg = AUTONEG_ENABLE;
> + cmd.base.phy_address = pep->phy_addr;
> + cmd.base.speed = pep->phy_speed;
> + cmd.base.duplex = pep->phy_duplex;
> + ethtool_convert_legacy_u32_to_link_mode(cmd.link_modes.advertising,
> + PHY_BASIC_FEATURES);
> + cmd.base.autoneg = AUTONEG_ENABLE;
>
> - if (cmd.speed != 0)
> - cmd.autoneg = AUTONEG_DISABLE;
> + if (cmd.base.speed != 0)
> + cmd.base.autoneg = AUTONEG_DISABLE;
>
> - return pxa168_set_settings(dev, &cmd);
> + return phy_ethtool_set_link_ksettings(dev, &cmd);
This duplicates quite a bit of code that the core PHYLIB already deals
with, you should plan for a subsequent cleanup patch which removes all
of this.
--
Florian
Powered by blists - more mailing lists