Skip to content

Commit fef364b

Browse files
moonlinuxvinodkoul
authored andcommitted
phy: amlogic: phy-meson-axg-pcie: 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 a77e2e8 commit fef364b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,15 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
131131
struct phy_axg_pcie_priv *priv;
132132
struct device_node *np = dev->of_node;
133133
void __iomem *base;
134-
int ret;
135134

136135
priv = devm_kmalloc(dev, sizeof(*priv), GFP_KERNEL);
137136
if (!priv)
138137
return -ENOMEM;
139138

140139
priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
141-
if (IS_ERR(priv->phy)) {
142-
ret = PTR_ERR(priv->phy);
143-
if (ret != -EPROBE_DEFER)
144-
dev_err(dev, "failed to create PHY\n");
145-
return ret;
146-
}
140+
if (IS_ERR(priv->phy))
141+
return dev_err_probe(dev, PTR_ERR(priv->phy),
142+
"failed to create PHY\n");
147143

148144
base = devm_platform_ioremap_resource(pdev, 0);
149145
if (IS_ERR(base))

0 commit comments

Comments
 (0)