From: Yuan Can <yuancan@huawei.com>
To: <agross@kernel.org>, <andersson@kernel.org>,
<konrad.dybcio@somainline.org>, <kishon@ti.com>,
<vkoul@kernel.org>, <linux-arm-msm@vger.kernel.org>,
<linux-phy@lists.infradead.org>
Cc: <yuancan@huawei.com>
Subject: [PATCH RESEND 2/4] phy: qcom-qmp-pcie-msm8996: Use dev_err_probe() to simplify code
Date: Sat, 24 Sep 2022 07:02:58 +0000 [thread overview]
Message-ID: <20220924070300.25080-3-yuancan@huawei.com> (raw)
In-Reply-To: <20220924070300.25080-1-yuancan@huawei.com>
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>
---
drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
index 245f6dc1710e..690e0825e3b1 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c
@@ -880,12 +880,9 @@ static int qmp_pcie_msm8996_probe(struct platform_device *pdev)
return ret;
ret = qmp_pcie_msm8996_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 ? */
--
2.17.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2022-09-24 7:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-24 7:02 [PATCH RESEND 0/4] phy: Use dev_err_probe() to simplify code Yuan Can
2022-09-24 7:02 ` [PATCH RESEND 1/4] phy: qcom-qmp-combo: " Yuan Can
2022-09-24 7:02 ` Yuan Can [this message]
2022-09-24 7:02 ` [PATCH RESEND 3/4] phy: qcom-qmp-ufs: " Yuan Can
2022-09-24 7:03 ` [PATCH RESEND 4/4] phy: qcom-qmp-usb: " Yuan Can
2022-09-24 7:33 ` [PATCH RESEND 0/4] phy: " Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220924070300.25080-3-yuancan@huawei.com \
--to=yuancan@huawei.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=kishon@ti.com \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).