Skip to content

Commit 0545791

Browse files
moonlinuxvinodkoul
authored andcommitted
phy: amlogic: phy-meson-gxl-usb2: Simplify error handling with dev_err_probe()
Use dev_err_probe() for phy resources to indicate the deferral reason when waiting for the resource to come up. Signed-off-by: Anand Moon <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 686b273 commit 0545791

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/phy/amlogic/phy-meson-gxl-usb2.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
237237
struct phy_meson_gxl_usb2_priv *priv;
238238
struct phy *phy;
239239
void __iomem *base;
240-
int ret;
241240

242241
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
243242
if (!priv)
@@ -266,13 +265,9 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
266265
return PTR_ERR(priv->reset);
267266

268267
phy = devm_phy_create(dev, NULL, &phy_meson_gxl_usb2_ops);
269-
if (IS_ERR(phy)) {
270-
ret = PTR_ERR(phy);
271-
if (ret != -EPROBE_DEFER)
272-
dev_err(dev, "failed to create PHY\n");
273-
274-
return ret;
275-
}
268+
if (IS_ERR(phy))
269+
return dev_err_probe(dev, PTR_ERR(phy),
270+
"failed to create PHY\n");
276271

277272
phy_set_drvdata(phy, priv);
278273

0 commit comments

Comments
 (0)