Skip to contentSkip to conversation

phy: omap-usb2-phy: Use dev_err_probe()

PATCH Applied [email protected] 3 participants 3 messages Mar 23, 2023 – Mar 31, 2023 Generic PHY framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/phy/ti/phy-omap-usb2.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/phy/ti/phy-omap-usb2.c +3 -5
index bbe5d25b0351..762d3de8b3c5 100644
@@ -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");
Signature · 6 lines
2.25.1

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · 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.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Signature · 3 lines
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy