From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next 1/4] net: phy: Use C45 Helpers when forcing PHY Date: Mon, 22 Oct 2018 10:11:02 -0700 Message-ID: <8e1a35a5-de85-e7b3-c9f3-524b3313feaa@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Andrew Lunn , "David S. Miller" , Joao Pinto To: Jose Abreu , netdev@vger.kernel.org Return-path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:45846 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727218AbeJWBae (ORCPT ); Mon, 22 Oct 2018 21:30:34 -0400 Received: by mail-pf1-f193.google.com with SMTP id u12-v6so20209453pfn.12 for ; Mon, 22 Oct 2018 10:11:13 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/22/18 3:32 AM, Jose Abreu wrote: > If PHY is in force state and we have a C45 phy we need to use the > standard C45 helpers and not the C22 ones. > > Signed-off-by: Jose Abreu > Cc: Andrew Lunn > Cc: Florian Fainelli > Cc: "David S. Miller" > Cc: Joao Pinto > --- > drivers/net/phy/phy.c | 2 +- > include/linux/phy.h | 8 ++++++++ > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index 1d73ac3309ce..0ff4946e208e 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -995,7 +995,7 @@ void phy_state_machine(struct work_struct *work) > } > break; > case PHY_FORCING: > - err = genphy_update_link(phydev); > + err = phy_update_link(phydev); > if (err) > break; > > diff --git a/include/linux/phy.h b/include/linux/phy.h > index 3ea87f774a76..02c2ee8bc05b 100644 > --- a/include/linux/phy.h > +++ b/include/linux/phy.h > @@ -1044,6 +1044,14 @@ static inline int phy_read_status(struct phy_device *phydev) > return genphy_read_status(phydev); > } > > +static inline int phy_update_link(struct phy_device *phydev) > +{ > + if (phydev->is_c45) > + return gen10g_read_status(phydev); Should not this be genphy_c45_read_link() for symmetry with genphy_update_link() which only updates phydev->link? -- Florian