[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMdYzYon+uscEXS=ntmQWD-ROr4owvbQwuWdb2DLmh74Gri1mA@mail.gmail.com>
Date: Tue, 11 May 2021 18:56:31 -0400
From: Peter Geis <pgwipeout@...il.com>
To: Russell King - ARM Linux admin <linux@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
"open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>
Subject: Re: [PATCH] net: phy: add driver for Motorcomm yt8511 phy
On Tue, May 11, 2021 at 5:56 PM Russell King - ARM Linux admin
<linux@...linux.org.uk> wrote:
>
> Hi,
>
> On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
> > +static int yt8511_config_init(struct phy_device *phydev)
> > +{
> > + int ret, val, oldpage;
> > +
> > + /* set clock mode to 125mhz */
> > + oldpage = phy_select_page(phydev, YT8511_EXT_CLK_GATE);
> > + if (oldpage < 0)
> > + goto err_restore_page;
> > +
> > + val = __phy_read(phydev, YT8511_PAGE);
> > + val |= (YT8511_CLK_125M);
> > + ret = __phy_write(phydev, YT8511_PAGE, val);
>
> Please consider __phy_modify(), and handle any error it returns.
Hey that's really neat, thanks!
>
> > +
> > + /* disable auto sleep */
> > + ret = __phy_write(phydev, YT8511_PAGE_SELECT, YT8511_EXT_SLEEP_CTRL);
>
> Please consider handling a failure to write here.
Will do.
>
> > + val = __phy_read(phydev, YT8511_PAGE);
> > + val &= (~BIT(15));
> > + ret = __phy_write(phydev, YT8511_PAGE, val);
>
> Also a use for __phy_modify().
>
> > +
> > +err_restore_page:
> > + return phy_restore_page(phydev, oldpage, ret);
> > +}
> > +
> > +static struct phy_driver motorcomm_phy_drvs[] = {
> > + {
> > + PHY_ID_MATCH_EXACT(PHY_ID_YT8511),
> > + .name = "YT8511 Gigabit Ethernet",
> > + .config_init = &yt8511_config_init,
>
> Please drop the '&' here, it's unnecessary.
Will do, thank you.
>
> Thanks.
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists