From: Inochi Amaoto <inochiama@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>,
Inochi Amaoto <inochiama@gmail.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org,
Yixun Lan <dlan@gentoo.org>, Longbin Li <looong.bin@gmail.com>
Subject: Re: [PATCH v2 1/4] phy: core: Add common helper to add phy phandle device link
Date: Mon, 7 Sep 2026 19:33:41 +0800 [thread overview]
Message-ID: <ap6g-SwI6vvmdnB6@inochi.infowork> (raw)
In-Reply-To: <20260907110121.hfrblphv5vhzobj7@skbuf>
On Mon, Sep 07, 2026 at 02:01:21PM +0300, Vladimir Oltean wrote:
> On Fri, Sep 04, 2026 at 04:37:05PM +0800, Inochi Amaoto wrote:
> > It is very common for adding a device link for phy phandle
> > for device managed phy helper functions. So add a common
> > helper for future reuse.
> >
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> > drivers/phy/phy-core.c | 38 +++++++++++++++++++++++---------------
> > 1 file changed, 23 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> > index 21aaf2f76e53..ea79913fbb87 100644
> > --- a/drivers/phy/phy-core.c
> > +++ b/drivers/phy/phy-core.c
> > @@ -606,6 +606,26 @@ int phy_validate(struct phy *phy, enum phy_mode mode, int submode,
> > }
> > EXPORT_SYMBOL_GPL(phy_validate);
> >
> > +/**
> > + * phy_add_device_link() - Associate the phy with the device
> > + * @dev: the device to link the phy
> > + * @phy: the phy to associate
> > + *
> > + * Associate the phy with the device by using device link.
>
> I guess it would be good to specify somewhere "consumer" device, because
> there are multiple devices involved.
>
Reasonable. I will update this comment. Thanks.
Regards,
Inochi
> > + */
> > +static void phy_add_device_link(struct device *dev, struct phy *phy)
> > +{
> > + struct device_link *link;
> > +
> > + if (!phy)
> > + return;
> > +
> > + link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
> > + if (!link)
> > + dev_dbg(dev, "failed to create device link to %s\n",
> > + dev_name(phy->dev.parent));
> > +}
> > +
> > /**
> > * _of_phy_get() - lookup and obtain a reference to a phy by phandle
> > * @np: device_node for which to get the phy
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-09-07 11:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 8:37 [PATCH v2 0/4] phy: core: Add phy bulk helpers support Inochi Amaoto
2026-09-04 8:37 ` [PATCH v2 1/4] phy: core: Add common helper to add phy phandle device link Inochi Amaoto
2026-09-04 8:50 ` sashiko-bot
2026-09-05 8:02 ` Andy Shevchenko
2026-09-07 11:01 ` Vladimir Oltean
2026-09-07 11:33 ` Inochi Amaoto [this message]
2026-09-04 8:37 ` [PATCH v2 2/4] phy: core: Add common helper for get phy phandle by index Inochi Amaoto
2026-09-04 8:48 ` sashiko-bot
2026-09-05 8:14 ` Andy Shevchenko
2026-09-07 11:03 ` Vladimir Oltean
2026-09-07 11:30 ` Inochi Amaoto
2026-09-04 8:37 ` [PATCH v2 3/4] phy: core: Add phy bulk data helper functions Inochi Amaoto
2026-09-04 8:50 ` sashiko-bot
2026-09-07 10:56 ` Vladimir Oltean
2026-09-07 11:37 ` Inochi Amaoto
2026-09-07 11:48 ` Vladimir Oltean
2026-09-07 12:15 ` Inochi Amaoto
2026-09-07 12:43 ` Vladimir Oltean
2026-09-07 22:20 ` Inochi Amaoto
2026-09-04 8:37 ` [PATCH v2 4/4] phy: core: Add managed " Inochi Amaoto
2026-09-07 10:28 ` [PATCH v2 0/4] phy: core: Add phy bulk helpers support Vladimir Oltean
2026-09-07 11:29 ` Inochi Amaoto
2026-09-07 11:57 ` Vladimir Oltean
2026-09-07 12:05 ` Inochi Amaoto
2026-09-07 12:16 ` Vladimir Oltean
2026-09-07 13:04 ` Vladimir Oltean
2026-09-07 22:28 ` Inochi Amaoto
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=ap6g-SwI6vvmdnB6@inochi.infowork \
--to=inochiama@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dlan@gentoo.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=looong.bin@gmail.com \
--cc=mani@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=vkoul@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