Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <linux.amoon@gmail.com>
Link: https://lore.kernel.org/r/20241012071919.3726-2-linux.amoon@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Anand Moon and committed by
Vinod Koul
84de9180 40384c84

+3 -6
+3 -6
drivers/phy/rockchip/phy-rockchip-pcie.c
··· 371 371 mutex_init(&rk_phy->pcie_mutex); 372 372 373 373 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"); 380 377 381 378 rk_phy->clk_pciephy_ref = devm_clk_get(dev, "refclk"); 382 379 if (IS_ERR(rk_phy->clk_pciephy_ref)) {