* [PATCH linux-next 1/5] phy: allwinner: phy-sun50i-usb3: Use dev_err_probe()
2025-04-02 11:41 [PATCH linux-next 0/5] Use dev_err_probe() in phy shao.mingyin
@ 2025-04-02 11:42 ` shao.mingyin
2025-04-03 17:39 ` Jernej Škrabec
2025-04-02 11:43 ` [PATCH linux-next 2/5] phy: broadcom: phy-bcm63xx-usbh: " shao.mingyin
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: shao.mingyin @ 2025-04-02 11:42 UTC (permalink / raw)
To: vkoul, robert.marko
Cc: kishon, wens, jernej.skrabec, samuel, zhang.enpei, linux-phy,
linux-arm-kernel, linux-sunxi, linux-kernel, luka.perkov,
linux-arm-msm, heiko, linux-rockchip, yang.yang29, xu.xin16,
ye.xingchen
From: Zhang Enpei <zhang.enpei@zte.com.cn>
Replace the open-code with dev_err_probe() to simplify the code.
Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/phy/allwinner/phy-sun50i-usb3.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/allwinner/phy-sun50i-usb3.c b/drivers/phy/allwinner/phy-sun50i-usb3.c
index 363f9a0df503..b03faffc160d 100644
--- a/drivers/phy/allwinner/phy-sun50i-usb3.c
+++ b/drivers/phy/allwinner/phy-sun50i-usb3.c
@@ -141,11 +141,9 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)
return -ENOMEM;
phy->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(phy->clk)) {
- if (PTR_ERR(phy->clk) != -EPROBE_DEFER)
- dev_err(dev, "failed to get phy clock\n");
- return PTR_ERR(phy->clk);
- }
+ if (IS_ERR(phy->clk))
+ return dev_err_probe(dev, PTR_ERR(phy->clk),
+ "failed to get phy clock\n");
phy->reset = devm_reset_control_get(dev, NULL);
if (IS_ERR(phy->reset)) {
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH linux-next 1/5] phy: allwinner: phy-sun50i-usb3: Use dev_err_probe()
2025-04-02 11:42 ` [PATCH linux-next 1/5] phy: allwinner: phy-sun50i-usb3: Use dev_err_probe() shao.mingyin
@ 2025-04-03 17:39 ` Jernej Škrabec
0 siblings, 0 replies; 9+ messages in thread
From: Jernej Škrabec @ 2025-04-03 17:39 UTC (permalink / raw)
To: vkoul, robert.marko, shao.mingyin
Cc: kishon, wens, samuel, zhang.enpei, linux-phy, linux-arm-kernel,
linux-sunxi, linux-kernel, luka.perkov, linux-arm-msm, heiko,
linux-rockchip, yang.yang29, xu.xin16, ye.xingchen
Dne sreda, 2. april 2025 ob 13:42:03 Srednjeevropski poletni čas je shao.mingyin@zte.com.cn napisal(a):
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
>
> Replace the open-code with dev_err_probe() to simplify the code.
>
> Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/phy/allwinner/phy-sun50i-usb3.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/phy/allwinner/phy-sun50i-usb3.c b/drivers/phy/allwinner/phy-sun50i-usb3.c
> index 363f9a0df503..b03faffc160d 100644
> --- a/drivers/phy/allwinner/phy-sun50i-usb3.c
> +++ b/drivers/phy/allwinner/phy-sun50i-usb3.c
> @@ -141,11 +141,9 @@ static int sun50i_usb3_phy_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> phy->clk = devm_clk_get(dev, NULL);
> - if (IS_ERR(phy->clk)) {
> - if (PTR_ERR(phy->clk) != -EPROBE_DEFER)
> - dev_err(dev, "failed to get phy clock\n");
> - return PTR_ERR(phy->clk);
> - }
> + if (IS_ERR(phy->clk))
> + return dev_err_probe(dev, PTR_ERR(phy->clk),
> + "failed to get phy clock\n");
>
> phy->reset = devm_reset_control_get(dev, NULL);
> if (IS_ERR(phy->reset)) {
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH linux-next 2/5] phy: broadcom: phy-bcm63xx-usbh: Use dev_err_probe()
2025-04-02 11:41 [PATCH linux-next 0/5] Use dev_err_probe() in phy shao.mingyin
2025-04-02 11:42 ` [PATCH linux-next 1/5] phy: allwinner: phy-sun50i-usb3: Use dev_err_probe() shao.mingyin
@ 2025-04-02 11:43 ` shao.mingyin
2025-04-02 11:43 ` [PATCH linux-next 3/5] phy: qualcomm: phy-qcom-ipq4019-usb: " shao.mingyin
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: shao.mingyin @ 2025-04-02 11:43 UTC (permalink / raw)
To: vkoul, robert.marko
Cc: kishon, wens, jernej.skrabec, samuel, zhang.enpei, linux-phy,
linux-arm-kernel, linux-sunxi, linux-kernel, luka.perkov,
linux-arm-msm, heiko, linux-rockchip, yang.yang29, xu.xin16,
ye.xingchen
From: Zhang Enpei <zhang.enpei@zte.com.cn>
Replace the open-code with dev_err_probe() to simplify the code.
Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/phy/broadcom/phy-bcm63xx-usbh.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/broadcom/phy-bcm63xx-usbh.c b/drivers/phy/broadcom/phy-bcm63xx-usbh.c
index 647644de041b..b9e7f750567c 100644
--- a/drivers/phy/broadcom/phy-bcm63xx-usbh.c
+++ b/drivers/phy/broadcom/phy-bcm63xx-usbh.c
@@ -397,11 +397,9 @@ static int __init bcm63xx_usbh_phy_probe(struct platform_device *pdev)
return PTR_ERR(usbh->base);
usbh->reset = devm_reset_control_get_exclusive(dev, NULL);
- if (IS_ERR(usbh->reset)) {
- if (PTR_ERR(usbh->reset) != -EPROBE_DEFER)
- dev_err(dev, "failed to get reset\n");
- return PTR_ERR(usbh->reset);
- }
+ if (IS_ERR(usbh->reset))
+ return dev_err_probe(dev, PTR_ERR(usbh->reset),
+ "failed to get reset\n");
usbh->usbh_clk = devm_clk_get_optional(dev, "usbh");
if (IS_ERR(usbh->usbh_clk))
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH linux-next 3/5] phy: qualcomm: phy-qcom-ipq4019-usb: Use dev_err_probe()
2025-04-02 11:41 [PATCH linux-next 0/5] Use dev_err_probe() in phy shao.mingyin
2025-04-02 11:42 ` [PATCH linux-next 1/5] phy: allwinner: phy-sun50i-usb3: Use dev_err_probe() shao.mingyin
2025-04-02 11:43 ` [PATCH linux-next 2/5] phy: broadcom: phy-bcm63xx-usbh: " shao.mingyin
@ 2025-04-02 11:43 ` shao.mingyin
2025-04-02 14:19 ` Dmitry Baryshkov
2025-04-02 11:44 ` [PATCH linux-next 4/5] phy: lantiq: phy-lantiq-rcu-usb2: " shao.mingyin
2025-04-02 11:45 ` [PATCH linux-next 5/5] phy: rockchip: phy-rockchip-typec: " shao.mingyin
4 siblings, 1 reply; 9+ messages in thread
From: shao.mingyin @ 2025-04-02 11:43 UTC (permalink / raw)
To: vkoul, robert.marko
Cc: kishon, wens, jernej.skrabec, samuel, zhang.enpei, linux-phy,
linux-arm-kernel, linux-sunxi, linux-kernel, luka.perkov,
linux-arm-msm, heiko, linux-rockchip, yang.yang29, xu.xin16,
ye.xingchen
From: Zhang Enpei <zhang.enpei@zte.com.cn>
Replace the open-code with dev_err_probe() to simplify the code.
Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c
index da6f290af722..738b3015747f 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c
@@ -109,11 +109,9 @@ static int ipq4019_usb_phy_probe(struct platform_device *pdev)
}
phy->por_rst = devm_reset_control_get(phy->dev, "por_rst");
- if (IS_ERR(phy->por_rst)) {
- if (PTR_ERR(phy->por_rst) != -EPROBE_DEFER)
- dev_err(dev, "POR reset is missing\n");
- return PTR_ERR(phy->por_rst);
- }
+ if (IS_ERR(phy->por_rst))
+ return dev_err_probe(dev, PTR_ERR(phy->por_rst),
+ "POR reset is missing\n");
phy->srif_rst = devm_reset_control_get_optional(phy->dev, "srif_rst");
if (IS_ERR(phy->srif_rst))
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH linux-next 3/5] phy: qualcomm: phy-qcom-ipq4019-usb: Use dev_err_probe()
2025-04-02 11:43 ` [PATCH linux-next 3/5] phy: qualcomm: phy-qcom-ipq4019-usb: " shao.mingyin
@ 2025-04-02 14:19 ` Dmitry Baryshkov
0 siblings, 0 replies; 9+ messages in thread
From: Dmitry Baryshkov @ 2025-04-02 14:19 UTC (permalink / raw)
To: shao.mingyin
Cc: vkoul, robert.marko, kishon, wens, jernej.skrabec, samuel,
zhang.enpei, linux-phy, linux-arm-kernel, linux-sunxi,
linux-kernel, luka.perkov, linux-arm-msm, heiko, linux-rockchip,
yang.yang29, xu.xin16, ye.xingchen
On Wed, Apr 02, 2025 at 07:43:57PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
>
> Replace the open-code with dev_err_probe() to simplify the code.
>
> Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
> drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH linux-next 4/5] phy: lantiq: phy-lantiq-rcu-usb2: Use dev_err_probe()
2025-04-02 11:41 [PATCH linux-next 0/5] Use dev_err_probe() in phy shao.mingyin
` (2 preceding siblings ...)
2025-04-02 11:43 ` [PATCH linux-next 3/5] phy: qualcomm: phy-qcom-ipq4019-usb: " shao.mingyin
@ 2025-04-02 11:44 ` shao.mingyin
2025-04-02 11:45 ` [PATCH linux-next 5/5] phy: rockchip: phy-rockchip-typec: " shao.mingyin
4 siblings, 0 replies; 9+ messages in thread
From: shao.mingyin @ 2025-04-02 11:44 UTC (permalink / raw)
To: vkoul, robert.marko
Cc: kishon, wens, jernej.skrabec, samuel, zhang.enpei, linux-phy,
linux-arm-kernel, linux-sunxi, linux-kernel, luka.perkov,
linux-arm-msm, heiko, linux-rockchip, yang.yang29, xu.xin16,
ye.xingchen
From: Zhang Enpei <zhang.enpei@zte.com.cn>
Replace the open-code with dev_err_probe() to simplify the code.
Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c b/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
index 82f1ffc0b0ad..7e4e42d62dbc 100644
--- a/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
+++ b/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
@@ -192,11 +192,9 @@ static int ltq_rcu_usb2_of_parse(struct ltq_rcu_usb2_priv *priv,
}
priv->ctrl_reset = devm_reset_control_get_shared(dev, "ctrl");
- if (IS_ERR(priv->ctrl_reset)) {
- if (PTR_ERR(priv->ctrl_reset) != -EPROBE_DEFER)
- dev_err(dev, "failed to get 'ctrl' reset\n");
- return PTR_ERR(priv->ctrl_reset);
- }
+ if (IS_ERR(priv->ctrl_reset))
+ return dev_err_probe(dev, PTR_ERR(priv->ctrl_reset),
+ "failed to get 'ctrl' reset\n");
priv->phy_reset = devm_reset_control_get_optional(dev, "phy");
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH linux-next 5/5] phy: rockchip: phy-rockchip-typec: Use dev_err_probe()
2025-04-02 11:41 [PATCH linux-next 0/5] Use dev_err_probe() in phy shao.mingyin
` (3 preceding siblings ...)
2025-04-02 11:44 ` [PATCH linux-next 4/5] phy: lantiq: phy-lantiq-rcu-usb2: " shao.mingyin
@ 2025-04-02 11:45 ` shao.mingyin
2025-04-05 23:03 ` Sebastian Reichel
4 siblings, 1 reply; 9+ messages in thread
From: shao.mingyin @ 2025-04-02 11:45 UTC (permalink / raw)
To: vkoul, robert.marko
Cc: kishon, wens, jernej.skrabec, samuel, zhang.enpei, linux-phy,
linux-arm-kernel, linux-sunxi, linux-kernel, luka.perkov,
linux-arm-msm, heiko, linux-rockchip, yang.yang29, xu.xin16,
ye.xingchen
From: Zhang Enpei <zhang.enpei@zte.com.cn>
Replace the open-code with dev_err_probe() to simplify the code.
Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
drivers/phy/rockchip/phy-rockchip-typec.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
index d9701b6106d5..94d1e6ead1a7 100644
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
@@ -1151,11 +1151,9 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
if (IS_ERR(tcphy->extcon)) {
if (PTR_ERR(tcphy->extcon) == -ENODEV) {
tcphy->extcon = NULL;
- } else {
- if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER)
- dev_err(dev, "Invalid or missing extcon\n");
- return PTR_ERR(tcphy->extcon);
- }
+ } else
+ return dev_err_probe(dev, PTR_ERR(tcphy->extcon),
+ "Invalid or missing extcon\n");
}
pm_runtime_enable(dev);
--
2.25.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH linux-next 5/5] phy: rockchip: phy-rockchip-typec: Use dev_err_probe()
2025-04-02 11:45 ` [PATCH linux-next 5/5] phy: rockchip: phy-rockchip-typec: " shao.mingyin
@ 2025-04-05 23:03 ` Sebastian Reichel
0 siblings, 0 replies; 9+ messages in thread
From: Sebastian Reichel @ 2025-04-05 23:03 UTC (permalink / raw)
To: shao.mingyin
Cc: vkoul, robert.marko, kishon, wens, jernej.skrabec, samuel,
zhang.enpei, linux-phy, linux-arm-kernel, linux-sunxi,
linux-kernel, luka.perkov, linux-arm-msm, heiko, linux-rockchip,
yang.yang29, xu.xin16, ye.xingchen
[-- Attachment #1.1: Type: text/plain, Size: 1566 bytes --]
Hi,
On Wed, Apr 02, 2025 at 07:45:42PM +0800, shao.mingyin@zte.com.cn wrote:
> From: Zhang Enpei <zhang.enpei@zte.com.cn>
>
> Replace the open-code with dev_err_probe() to simplify the code.
>
> Signed-off-by: Zhang Enpei <zhang.enpei@zte.com.cn>
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
> drivers/phy/rockchip/phy-rockchip-typec.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
> index d9701b6106d5..94d1e6ead1a7 100644
> --- a/drivers/phy/rockchip/phy-rockchip-typec.c
> +++ b/drivers/phy/rockchip/phy-rockchip-typec.c
> @@ -1151,11 +1151,9 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
> if (IS_ERR(tcphy->extcon)) {
> if (PTR_ERR(tcphy->extcon) == -ENODEV) {
> tcphy->extcon = NULL;
> - } else {
> - if (PTR_ERR(tcphy->extcon) != -EPROBE_DEFER)
> - dev_err(dev, "Invalid or missing extcon\n");
> - return PTR_ERR(tcphy->extcon);
> - }
> + } else
> + return dev_err_probe(dev, PTR_ERR(tcphy->extcon),
> + "Invalid or missing extcon\n");
You should also remove the { } for the normal if clause. Otherwise
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
But you might want to throw in an extra patch updating the error
message. -ENODEV is covered explicitly, so it's not "missing". I
suggest "Failed to get extcon".
Greetings,
-- Sebastian
> }
>
> pm_runtime_enable(dev);
> --
> 2.25.1
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 112 bytes --]
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 9+ messages in thread