Skip to content

Commit 84de918

Browse files
moonlinuxvinodkoul
authored andcommitted
phy: rockchip-pcie: Simplify error handling with dev_err_probe()
Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when -EDEFER is returned and useless error is printed. Signed-off-by: Anand Moon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 40384c8 commit 84de918

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/phy/rockchip/phy-rockchip-pcie.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,9 @@ static int rockchip_pcie_phy_probe(struct platform_device *pdev)
371371
mutex_init(&rk_phy->pcie_mutex);
372372

373373
rk_phy->phy_rst = devm_reset_control_get(dev, "phy");
374-
if (IS_ERR(rk_phy->phy_rst)) {
375-
if (PTR_ERR(rk_phy->phy_rst) != -EPROBE_DEFER)
376-
dev_err(dev,
377-
"missing phy property for reset controller\n");
378-
return PTR_ERR(rk_phy->phy_rst);
379-
}
374+
if (IS_ERR(rk_phy->phy_rst))
375+
return dev_err_probe(&pdev->dev, PTR_ERR(rk_phy->phy_rst),
376+
"missing phy property for reset controller\n");
380377

381378
rk_phy->clk_pciephy_ref = devm_clk_get(dev, "refclk");
382379
if (IS_ERR(rk_phy->clk_pciephy_ref)) {

0 commit comments

Comments
 (0)