diff options
author | Yuan Can <yuancan@huawei.com> | 2022-09-24 07:02:59 +0000 |
---|---|---|
committer | Steev Klimaszewski <steev@kali.org> | 2022-10-26 10:58:41 -0500 |
commit | 6ad365def9d39e715985be1df8db98015e495883 (patch) | |
tree | 578e3f818337c5a971cc7a236a584a8c907df2e7 | |
parent | 886755ac21a9fb0d89cadfd81c6890c782d27a21 (diff) |
phy: qcom-qmp-ufs: 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>
-rw-r--r-- | drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c index c8583f5a54bd..8ed1774a5d6c 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -1317,12 +1317,9 @@ static int qcom_qmp_phy_ufs_probe(struct platform_device *pdev) return ret; ret = qcom_qmp_phy_ufs_vreg_init(dev, cfg); - 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"); num = of_get_available_child_count(dev->of_node); /* do we have a rogue child node ? */ |