* [PATCH] phy: ingenic: use core driver model helper to handle probe errors
@ 2025-07-24 10:35 Akhilesh Patil
2025-08-20 17:03 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Akhilesh Patil @ 2025-07-24 10:35 UTC (permalink / raw)
To: vkoul, kishon, akhilesh, a.hajda, aric.pzqi
Cc: linux-phy, linux-kernel, akhileshpatilvnit, skhan
Use core driver model helper dev_err_probe() defined at
drivers/base/core.c in driver probe path to propagate errors.
standardize and improve the code of deferred probe error handling
using this helper for ingenic usb phy driver.
Inspired by,
commit a787e5400a1ce ("driver core: add device probe log helper")
Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
Cc: Andrzej Hajda <a.hajda@samsung.com>
---
drivers/phy/ingenic/phy-ingenic-usb.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/phy/ingenic/phy-ingenic-usb.c b/drivers/phy/ingenic/phy-ingenic-usb.c
index eb2721f72a4c..7e62d46850fd 100644
--- a/drivers/phy/ingenic/phy-ingenic-usb.c
+++ b/drivers/phy/ingenic/phy-ingenic-usb.c
@@ -339,17 +339,13 @@ static int ingenic_usb_phy_probe(struct platform_device *pdev)
priv->clk = devm_clk_get(dev, NULL);
if (IS_ERR(priv->clk)) {
err = PTR_ERR(priv->clk);
- if (err != -EPROBE_DEFER)
- dev_err(dev, "Failed to get clock\n");
- return err;
+ return dev_err_probe(dev, err, "Failed to get clock\n");
}
priv->vcc_supply = devm_regulator_get(dev, "vcc");
if (IS_ERR(priv->vcc_supply)) {
err = PTR_ERR(priv->vcc_supply);
- if (err != -EPROBE_DEFER)
- dev_err(dev, "Failed to get regulator\n");
- return err;
+ return dev_err_probe(dev, err, "Failed to get regulator\n");
}
priv->phy = devm_phy_create(dev, NULL, &ingenic_usb_phy_ops);
--
2.34.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] phy: ingenic: use core driver model helper to handle probe errors
2025-07-24 10:35 [PATCH] phy: ingenic: use core driver model helper to handle probe errors Akhilesh Patil
@ 2025-08-20 17:03 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2025-08-20 17:03 UTC (permalink / raw)
To: kishon, aric.pzqi, Andrzej Hajda, Akhilesh Patil
Cc: linux-phy, linux-kernel, akhileshpatilvnit, skhan
On Thu, 24 Jul 2025 16:05:07 +0530, Akhilesh Patil wrote:
> Use core driver model helper dev_err_probe() defined at
> drivers/base/core.c in driver probe path to propagate errors.
> standardize and improve the code of deferred probe error handling
> using this helper for ingenic usb phy driver.
> Inspired by,
> commit a787e5400a1ce ("driver core: add device probe log helper")
>
> [...]
Applied, thanks!
[1/1] phy: ingenic: use core driver model helper to handle probe errors
commit: 38404274bbee1f0001a490c0dc98aac32a4d7c9d
Best regards,
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-20 20:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24 10:35 [PATCH] phy: ingenic: use core driver model helper to handle probe errors Akhilesh Patil
2025-08-20 17:03 ` Vinod Koul
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).