From: sashiko-bot@kernel.org
To: "Bryan O'Donoghue" <bryan.odonoghue@linaro.org>
Cc: conor+dt@kernel.org, media-ci@linuxtv.org,
linux-clk@vger.kernel.org, robh@kernel.org,
devicetree@vger.kernel.org, olteanv@gmail.com,
linux-phy@lists.infradead.org, vkoul@kernel.org,
neil.armstrong@linaro.org
Subject: Re: [PATCH v18 3/5] phy: core: Add devm_phy_get_by_of_node()
Date: Thu, 17 Sep 2026 11:18:45 +0000 [thread overview]
Message-ID: <20260917111846.08AC41F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260917-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v18-3-f85c9103177e@linaro.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] phy: inconsistent log severity for device link failure
--
commit dbacb9631ec7d71b290bf2c4c3bb57ed433e17f3
Author: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
phy: core: Add devm_phy_get_by_of_node()
This commit adds a devm variant of phy_get_by_of_node() to allow for
automatic resource release on the driver's exit path.
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 490a7cde6d40a..10e9323566803 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -833,7 +833,7 @@ struct phy *phy_get(struct device *dev, const char *string)
>
> link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
> if (!link)
> - dev_dbg(dev, "failed to create device link to %s\n",
> + dev_err(dev, "failed to create device link to %s\n",
[Severity: Low]
Is this change in logging severity from dev_dbg to dev_err intentional?
If so, should it be documented in the commit message?
> dev_name(phy->dev.parent));
>
> out_unlock:
[ ... ]
> @@ -1050,6 +1050,40 @@ struct phy *phy_get_by_of_node(struct device_node *np)
> }
> EXPORT_SYMBOL_GPL(phy_get_by_of_node);
>
> +/**
> + * devm_phy_get_by_of_node() - devm managed lookup and obtain phy reference by device node
> + * @dev: device requesting the PHY
> + * @np: device_node of the PHY provider
> + *
> + * Returns phy associated with the device_node or ERR_PTR. devres manages
> + * releasing resources.
> + */
> +struct phy *devm_phy_get_by_of_node(struct device *dev, struct device_node *np)
> +{
> + struct phy **ptr, *phy;
> + struct device_link *link;
> +
> + ptr = devres_alloc(devm_phy_release, sizeof(*ptr), GFP_KERNEL);
> + if (!ptr)
> + return ERR_PTR(-ENOMEM);
> +
> + phy = phy_get_by_of_node(np);
> + if (IS_ERR(phy)) {
> + devres_free(ptr);
> + return phy;
> + }
> +
> + *ptr = phy;
> + devres_add(dev, ptr);
> + link = device_link_add(dev, &phy->dev, DL_FLAG_STATELESS);
> + if (!link)
> + dev_dbg(dev, "failed to create device link to %s\n",
[Severity: Low]
Since phy_get() was updated to use dev_err() for device_link_add() failures
above, should devm_phy_get_by_of_node() also use dev_err() here for
consistency?
> + dev_name(phy->dev.parent));
> +
> + return phy;
> +}
> +EXPORT_SYMBOL_GPL(devm_phy_get_by_of_node);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v18-0-f85c9103177e@linaro.org?part=3
next prev parent reply other threads:[~2026-09-17 11:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 11:07 [PATCH v18 0/5] Add phy_get_by_of_node and devm helper Bryan O'Donoghue
2026-09-17 11:07 ` [PATCH v18 1/5] phy: core: Fix race-condition between _of_phy_get() and try_module_get() Bryan O'Donoghue
2026-09-17 11:07 ` [PATCH v18 2/5] phy: core: Add phy_get_by_of_node() Bryan O'Donoghue
2026-09-17 11:18 ` sashiko-bot
2026-09-17 12:29 ` Neil Armstrong
2026-09-17 12:32 ` Bryan O'Donoghue
2026-09-17 11:07 ` [PATCH v18 3/5] phy: core: Add devm_phy_get_by_of_node() Bryan O'Donoghue
2026-09-17 11:18 ` sashiko-bot [this message]
2026-09-17 12:32 ` Neil Armstrong
2026-09-17 12:43 ` Bryan O'Donoghue
2026-09-17 13:27 ` Bryan O'Donoghue
2026-09-17 15:03 ` Bryan O'Donoghue
2026-09-17 11:07 ` [PATCH v18 4/5] media: qcom: camss: Add support for PHY API devices Bryan O'Donoghue
2026-09-17 11:19 ` sashiko-bot
2026-09-17 11:07 ` [PATCH v18 5/5] media: qcom: camss: Use data-lanes starting at 1 for new CSIPHY mode Bryan O'Donoghue
2026-09-17 13:05 ` Loic Poulain
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=20260917111846.08AC41F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=media-ci@linuxtv.org \
--cc=neil.armstrong@linaro.org \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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;
as well as URLs for NNTP newsgroup(s).