mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Geis <pgwipeout@gmail.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>
Subject: Re: [PATCH] net: phy: add driver for Motorcomm yt8511 phy
Date: Tue, 11 May 2021 18:56:31 -0400	[thread overview]
Message-ID: <CAMdYzYon+uscEXS=ntmQWD-ROr4owvbQwuWdb2DLmh74Gri1mA@mail.gmail.com> (raw)
In-Reply-To: <20210511215644.GO1336@shell.armlinux.org.uk>

On Tue, May 11, 2021 at 5:56 PM Russell King - ARM Linux admin
<linux@armlinux.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!

  reply	other threads:[~2021-05-11 22:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 21:46 Peter Geis
2021-05-11 21:56 ` Russell King - ARM Linux admin
2021-05-11 22:56   ` Peter Geis [this message]
2021-05-18  8:59 ` Leon Romanovsky
2021-05-19  0:20   ` Peter Geis
2021-05-19  8:18     ` Leon Romanovsky
2021-05-19 10:37       ` Heiner Kallweit
2021-05-19 11:50         ` Leon Romanovsky
2021-05-19 12:45           ` Peter Geis
2021-05-19 12:56             ` Leon Romanovsky
2021-05-19 13:15               ` Russell King (Oracle)
2021-05-19 13:25                 ` Peter Geis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMdYzYon+uscEXS=ntmQWD-ROr4owvbQwuWdb2DLmh74Gri1mA@mail.gmail.com' \
    --to=pgwipeout@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®