[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191011094759.na2z5gkced2qlyv3@verge.net.au>
Date: Fri, 11 Oct 2019 11:47:59 +0200
From: Simon Horman <horms@...ge.net.au>
To: Marek Vasut <marex@...x.de>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
"David S . Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
George McCollister <george.mccollister@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Tristram Ha <Tristram.Ha@...rochip.com>,
Woojung Huh <woojung.huh@...rochip.com>
Subject: Re: [PATCH V2 1/2] net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs
On Fri, Oct 11, 2019 at 08:52:13AM +0200, Marek Vasut wrote:
> On 10/11/19 7:57 AM, Simon Horman wrote:
> [...]
> >> +static int ksz8795_match_phy_device(struct phy_device *phydev)
> >> +{
> >> + int ret;
> >> +
> >> + if ((phydev->phy_id & MICREL_PHY_ID_MASK) != PHY_ID_KSZ8795)
> >> + return 0;
> >> +
> >> + ret = phy_read(phydev, MII_BMSR);
> >> + if (ret < 0)
> >> + return ret;
> >> +
> >> + /* See comment in ksz8051_match_phy_device() for details. */
> >> + return !(ret & BMSR_ERCAP);
> >> +}
> >> +
> >
> > Hi Marek,
> >
> > given the similarity between ksz8051_match_phy_device() and
> > ksz8795_match_phy_device() I wonder if a common helper is appropriate.
>
> Then one (or both) of them look like this:
>
> static int ksz8795_match_phy_device(struct phy_device *phydev)
> {
> int ret;
>
> /* See comment in ksz8051_match_phy_device() for details. */
> ret = ksz8051_match_phy_device(phydev);
> if (ret < 0)
> return ret;
>
> return !ret;
> }
>
> It's not that much better.
Hi Marek,
I think I slightly prefer this but I do see your point
and I have no objections to leaving the patch as-is.
Powered by blists - more mailing lists