2023-03-23 07:48:32

by ye.xingchen

[permalink] [raw]
Subject: [PATCH] phy: omap-usb2-phy: Use dev_err_probe()

From: Ye Xingchen <[email protected]>

Replace the open-code with dev_err_probe() to simplify the code.

Signed-off-by: Ye Xingchen <[email protected]>
---
drivers/phy/ti/phy-omap-usb2.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
index bbe5d25b0351..762d3de8b3c5 100644
--- a/drivers/phy/ti/phy-omap-usb2.c
+++ b/drivers/phy/ti/phy-omap-usb2.c
@@ -445,11 +445,9 @@ static int omap_usb2_probe(struct platform_device *pdev)
PTR_ERR(phy->wkupclk));
phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k");

- if (IS_ERR(phy->wkupclk)) {
- if (PTR_ERR(phy->wkupclk) != -EPROBE_DEFER)
- dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n");
- return PTR_ERR(phy->wkupclk);
- }
+ if (IS_ERR(phy->wkupclk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(phy->wkupclk),
+ "unable to get usb_phy_cm_clk32k\n");

dev_warn(&pdev->dev,
"found usb_phy_cm_clk32k, please fix DTS\n");
--
2.25.1


2023-03-23 09:24:40

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH] phy: omap-usb2-phy: Use dev_err_probe()

On Thu, Mar 23, 2023 at 03:45:52PM +0800, [email protected] wrote:
> From: Ye Xingchen <[email protected]>
>
> Replace the open-code with dev_err_probe() to simplify the code.
>
> Signed-off-by: Ye Xingchen <[email protected]>

Acked-by: Uwe Kleine-K?nig <[email protected]>

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |


Attachments:
(No filename) (493.00 B)
signature.asc (499.00 B)
Download all attachments

2023-03-31 13:54:57

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] phy: omap-usb2-phy: Use dev_err_probe()

On 23-03-23, 15:45, [email protected] wrote:
> From: Ye Xingchen <[email protected]>
>
> Replace the open-code with dev_err_probe() to simplify the code.

Applied, thanks

--
~Vinod