Skip to content

Commit 27a4046

Browse files
krzkvinodkoul
authored andcommitted
phy: ti: gmii-sel: Simplify with dev_err_probe()
Use dev_err_probe() to avoid dmesg flood on actual defer. This makes the code also simpler. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 29b44a3 commit 27a4046

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

drivers/phy/ti/phy-gmii-sel.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,9 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
468468
priv->regmap = syscon_node_to_regmap(node->parent);
469469
if (IS_ERR(priv->regmap)) {
470470
priv->regmap = device_node_to_regmap(node);
471-
if (IS_ERR(priv->regmap)) {
472-
ret = PTR_ERR(priv->regmap);
473-
dev_err(dev, "Failed to get syscon %d\n", ret);
474-
return ret;
475-
}
471+
if (IS_ERR(priv->regmap))
472+
return dev_err_probe(dev, PTR_ERR(priv->regmap),
473+
"Failed to get syscon\n");
476474
priv->no_offset = true;
477475
}
478476

@@ -485,11 +483,9 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
485483
priv->phy_provider =
486484
devm_of_phy_provider_register(dev,
487485
phy_gmii_sel_of_xlate);
488-
if (IS_ERR(priv->phy_provider)) {
489-
ret = PTR_ERR(priv->phy_provider);
490-
dev_err(dev, "Failed to create phy provider %d\n", ret);
491-
return ret;
492-
}
486+
if (IS_ERR(priv->phy_provider))
487+
return dev_err_probe(dev, PTR_ERR(priv->phy_provider),
488+
"Failed to create phy provider\n");
493489

494490
return 0;
495491
}

0 commit comments

Comments
 (0)