Thread (14 messages) 14 messages, 3 authors, 2024-08-21

Re: [PATCH v2 3/3] phy: phy-rockchip-inno-usb2: Improve error handling while probing

From: Heiko Stübner <heiko@sntech.de>
Date: 2024-08-21 08:43:47
Also in: linux-phy, linux-rockchip, lkml

Am Mittwoch, 21. August 2024, 09:37:55 CEST schrieb Dragan Simic:
Improve error handling in the probe path by using function dev_err_probe()
where appropriate, and by no longer using it rather pointlessly in one place
that actually produces a single, hardcoded error code.

Signed-off-by: Dragan Simic <redacted>
quoted hunk ↗ jump to hunk
@@ -1375,8 +1372,10 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
 	rphy->irq = platform_get_irq_optional(pdev, 0);
 	platform_set_drvdata(pdev, rphy);
 
-	if (!phy_cfgs)
-		return dev_err_probe(dev, -EINVAL, "phy configs are not assigned!\n");
+	if (!phy_cfgs) {
+		dev_err(dev, "phy configs are not assigned\n");
+		return -EINVAL;
+	}
 
 	ret = rockchip_usb2phy_extcon_register(rphy);
 	if (ret)
I really don't understand the rationale here. Using dev_err_probe here 
is just fine and with that change you just introduce more lines of code
for exactly the same functionality?


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help