From: Sascha Hauer <sha@pengutronix.de>
To: Yegor Yefremov <yegorslists@googlemail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] net: phy: add driver for MotorComm PHY
Date: Tue, 6 Jun 2023 11:58:51 +0200 [thread overview]
Message-ID: <20230606095851.GD18491@pengutronix.de> (raw)
In-Reply-To: <CAGm1_ks5-ODLSi_xyXrFsWB+98y724Ky2UtV823BxPnvmjLM-w@mail.gmail.com>
Hi Yegor,
On Tue, Jun 06, 2023 at 10:21:39AM +0200, Yegor Yefremov wrote:
> Hi Sascha,
>
>
> > + ret = phy_modify(phydev, YT8511_PAGE, YT8511_DELAY_FE_TX_EN, fe);
> > + if (ret < 0)
> > + goto err_restore_page;
> > +
> > + /* leave pll enabled in sleep */
> > + ret = phy_write(phydev, YT8511_PAGE_SELECT, YT8511_EXT_SLEEP_CTRL);
> > + if (ret < 0)
> > + goto err_restore_page;
> > +
> > + ret = phy_modify(phydev, YT8511_PAGE, 0, YT8511_PLLON_SLP);
> > + if (ret < 0)
> > + goto err_restore_page;
> > +
> > +err_restore_page:
> > + return phy_restore_page(phydev, oldpage, ret);
>
> As for this approach, it is also used by some other drivers in the Linux kernel:
>
> drivers/net/phy/realtek.c
> drivers/net/phy/icplus.c
It's ok like this. I didn't realize phy_restore_page() takes ret as
argument and returns it.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2023-06-06 10:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 8:17 yegorslists
2023-06-06 8:21 ` Yegor Yefremov
2023-06-06 9:58 ` Sascha Hauer [this message]
2023-06-08 10:48 ` Yegor Yefremov
2023-06-09 6:15 ` Sascha Hauer
2023-06-09 6:17 ` Sascha Hauer
2023-06-06 9:57 ` Sascha Hauer
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=20230606095851.GD18491@pengutronix.de \
--to=sha@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=yegorslists@googlemail.com \
/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