From: Russ Weight <russell.h.weight@intel.com>
To: Yang Yingliang <yangyingliang@huawei.com>, <linux-fpga@vger.kernel.org>
Cc: <mdf@kernel.org>, <hao.wu@intel.com>, <yilun.xu@intel.com>
Subject: Re: [PATCH -next resend] fpga: zynq: Switch to use dev_err_probe() helper
Date: Mon, 26 Sep 2022 09:09:37 -0700 [thread overview]
Message-ID: <c6981606-882e-b801-25ae-012da56d8309@intel.com> (raw)
In-Reply-To: <20220926141729.2292311-1-yangyingliang@huawei.com>
On 9/26/22 07:17, Yang Yingliang wrote:
> 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. It's more simple in error path.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Russ Weight <russell.h.weight@intel.com>
> ---
> Resend for adding SoB.
> ---
> drivers/fpga/zynq-fpga.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c
> index 426aa34c6a0d..ae0da361e6c6 100644
> --- a/drivers/fpga/zynq-fpga.c
> +++ b/drivers/fpga/zynq-fpga.c
> @@ -582,11 +582,9 @@ static int zynq_fpga_probe(struct platform_device *pdev)
> return priv->irq;
>
> priv->clk = devm_clk_get(dev, "ref_clk");
> - if (IS_ERR(priv->clk)) {
> - if (PTR_ERR(priv->clk) != -EPROBE_DEFER)
> - dev_err(dev, "input clock not found\n");
> - return PTR_ERR(priv->clk);
> - }
> + if (IS_ERR(priv->clk))
> + return dev_err_probe(dev, PTR_ERR(priv->clk),
> + "input clock not found\n");
>
> err = clk_prepare_enable(priv->clk);
> if (err) {
next prev parent reply other threads:[~2022-09-26 17:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 14:17 [PATCH -next resend] fpga: zynq: Switch to use dev_err_probe() helper Yang Yingliang
2022-09-26 16:09 ` Russ Weight [this message]
2022-09-30 2:44 ` Xu Yilun
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=c6981606-882e-b801-25ae-012da56d8309@intel.com \
--to=russell.h.weight@intel.com \
--cc=hao.wu@intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=yangyingliang@huawei.com \
--cc=yilun.xu@intel.com \
/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).