Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	agross@kernel.org, andersson@kernel.org,
	konrad.dybcio@somainline.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH -next] usb: typec: qcom-pmic-typec: Switch to use dev_err_probe() helper
Date: Thu, 22 Sep 2022 17:21:35 +0300	[thread overview]
Message-ID: <Yyxvby8nzHYVRk2u@kuha.fi.intel.com> (raw)
In-Reply-To: <20220922135708.2212249-1-yangyingliang@huawei.com>

On Thu, Sep 22, 2022 at 09:57:08PM +0800, 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: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/qcom-pmic-typec.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/qcom-pmic-typec.c b/drivers/usb/typec/qcom-pmic-typec.c
> index a0454a80c4a2..432ea62f1bab 100644
> --- a/drivers/usb/typec/qcom-pmic-typec.c
> +++ b/drivers/usb/typec/qcom-pmic-typec.c
> @@ -195,9 +195,8 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
>  
>  	qcom_usb->role_sw = fwnode_usb_role_switch_get(dev_fwnode(qcom_usb->dev));
>  	if (IS_ERR(qcom_usb->role_sw)) {
> -		if (PTR_ERR(qcom_usb->role_sw) != -EPROBE_DEFER)
> -			dev_err(dev, "failed to get role switch\n");
> -		ret = PTR_ERR(qcom_usb->role_sw);
> +		ret = dev_err_probe(dev, PTR_ERR(qcom_usb->role_sw),
> +				    "failed to get role switch\n");
>  		goto err_typec_port;
>  	}
>  
> -- 
> 2.25.1

-- 
heikki

      reply	other threads:[~2022-09-22 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 13:57 [PATCH -next] usb: typec: qcom-pmic-typec: Switch to use dev_err_probe() helper Yang Yingliang
2022-09-22 14:21 ` Heikki Krogerus [this message]

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=Yyxvby8nzHYVRk2u@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=yangyingliang@huawei.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