Skip to content

Commit de39730

Browse files
moonlinuxvinodkoul
authored andcommitted
phy: amlogic: phy-meson-axg-mipi-pcie-analog: 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 9bff4ef commit de39730

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
200200
struct phy_axg_mipi_pcie_analog_priv *priv;
201201
struct device_node *np = dev->of_node, *parent_np;
202202
struct regmap *map;
203-
int ret;
204203

205204
priv = devm_kmalloc(dev, sizeof(*priv), GFP_KERNEL);
206205
if (!priv)
@@ -219,12 +218,9 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev)
219218
priv->regmap = map;
220219

221220
priv->phy = devm_phy_create(dev, np, &phy_axg_mipi_pcie_analog_ops);
222-
if (IS_ERR(priv->phy)) {
223-
ret = PTR_ERR(priv->phy);
224-
if (ret != -EPROBE_DEFER)
225-
dev_err(dev, "failed to create PHY\n");
226-
return ret;
227-
}
221+
if (IS_ERR(priv->phy))
222+
return dev_err_probe(dev, PTR_ERR(priv->phy),
223+
"failed to create PHY\n");
228224

229225
phy_set_drvdata(priv->phy, priv);
230226
dev_set_drvdata(dev, priv);

0 commit comments

Comments
 (0)