Skip to contentSkip to conversation

phy: allwinner: Use dev_err_probe()

PATCH In review [email protected] 2 participants 2 messages Mar 23, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: allwinner: Use dev_err_probe()

From: Ye Xingchen <[email protected]>

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

---
 drivers/phy/allwinner/phy-sun50i-usb3.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/phy/allwinner/phy-sun50i-usb3.c +2 -5
index 84055b720016..c43087b85070 100644
@@ -140,11 +140,8 @@ 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)) {
Signature · 6 lines
2.25.1

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy