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 3/4] phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code Date: Sat, 24 Sep 2022 07:02:59 +0000 [thread overview] Message-ID: <20220924070300.25080-4-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-ufs.c | 9 +++------ 1 file 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 7b335b50b4a1..672ef4bbada7 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -1239,12 +1239,9 @@ static int qmp_ufs_probe(struct platform_device *pdev) return ret; ret = qmp_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 ? */ -- 2.17.1 -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy
WARNING: multiple messages have this Message-ID (diff)
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 3/4] phy: qcom-qmp-ufs: Use dev_err_probe() to simplify code Date: Sat, 24 Sep 2022 07:02:59 +0000 [thread overview] Message-ID: <20220924070300.25080-4-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-ufs.c | 9 +++------ 1 file 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 7b335b50b4a1..672ef4bbada7 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c @@ -1239,12 +1239,9 @@ static int qmp_ufs_probe(struct platform_device *pdev) return ret; ret = qmp_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 ? */ -- 2.17.1
next prev parent reply other threads:[~2022-09-24 7:05 UTC|newest] Thread overview: 12+ 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 ` Yuan Can 2022-09-24 7:02 ` [PATCH RESEND 1/4] phy: qcom-qmp-combo: " Yuan Can 2022-09-24 7:02 ` Yuan Can 2022-09-24 7:02 ` [PATCH RESEND 2/4] phy: qcom-qmp-pcie-msm8996: " Yuan Can 2022-09-24 7:02 ` 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:03 ` Yuan Can 2022-09-24 7:33 ` [PATCH RESEND 0/4] phy: " Vinod Koul 2022-09-24 7:33 ` 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-4-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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.