summaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorYuan Can <yuancan@huawei.com>2022-09-22 11:12:28 +0000
committerVinod Koul <vkoul@kernel.org>2022-09-24 12:07:30 +0530
commit668dc8afce43d4bc01feb3e929d6d5ffcb14f899 (patch)
tree13f92e9ec2fce1b2f2ed2484d87f4d18dac8729d /drivers/phy
parent72f1f6085a731efb655ba6308e1ac54b787b416f (diff)
downloadlinux-stable-668dc8afce43d4bc01feb3e929d6d5ffcb14f899.tar.gz
linux-stable-668dc8afce43d4bc01feb3e929d6d5ffcb14f899.tar.bz2
linux-stable-668dc8afce43d4bc01feb3e929d6d5ffcb14f899.zip
phy: qcom-snps: Use dev_err_probe() to simplify code
In the probe path, dev_err() can be replaced with dev_err_probe() which will check if error code is -EPROBE_DEFER and prints the error name. It also sets the defer probe reason which can be checked later through debugfs. Signed-off-by: Yuan Can <yuancan@huawei.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Link: https://lore.kernel.org/r/20220922111228.36355-8-yuancan@huawei.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
index 25022949108b..a59063596214 100644
--- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
+++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
@@ -559,12 +559,9 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev)
return PTR_ERR(hsphy->base);
hsphy->ref_clk = devm_clk_get(dev, "ref");
- if (IS_ERR(hsphy->ref_clk)) {
- ret = PTR_ERR(hsphy->ref_clk);
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "failed to get ref clk, %d\n", ret);
- return ret;
- }
+ if (IS_ERR(hsphy->ref_clk))
+ return dev_err_probe(dev, PTR_ERR(hsphy->ref_clk),
+ "failed to get ref clk\n");
hsphy->phy_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
if (IS_ERR(hsphy->phy_reset)) {
@@ -577,12 +574,9 @@ static int qcom_snps_hsphy_probe(struct platform_device *pdev)
hsphy->vregs[i].supply = qcom_snps_hsphy_vreg_names[i];
ret = devm_regulator_bulk_get(dev, num, hsphy->vregs);
- if (ret) {
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "failed to get regulator supplies: %d\n",
- ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "failed to get regulator supplies\n");
pm_runtime_set_active(dev);
pm_runtime_enable(dev);