Linux USB
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Yang Yingliang <yangyingliang@huawei.com>,
	linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org
Cc: linux@roeck-us.net, heikki.krogerus@linux.intel.com,
	agross@kernel.org, andersson@kernel.org,
	konrad.dybcio@linaro.org, gregkh@linuxfoundation.org,
	caleb.connolly@linaro.org
Subject: Re: [PATCH] usb: typec: qcom: fix return value check in qcom_pmic_typec_probe()
Date: Tue, 25 Jul 2023 15:35:07 +0100	[thread overview]
Message-ID: <e26e1738-73fb-77e0-3600-063ef5b9e083@linaro.org> (raw)
In-Reply-To: <20230725125319.565733-1-yangyingliang@huawei.com>

On 25/07/2023 13:53, Yang Yingliang wrote:
> device_get_named_child_node() returns NULL, if it fails, replace
> IS_ERR() with NULL pointer check.
> 
> Fixes: a4422ff22142 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>   drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
> index a905160dd860..9b467a346114 100644
> --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
> +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
> @@ -209,8 +209,8 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
>   	platform_set_drvdata(pdev, tcpm);
>   
>   	tcpm->tcpc.fwnode = device_get_named_child_node(tcpm->dev, "connector");
> -	if (IS_ERR(tcpm->tcpc.fwnode))
> -		return PTR_ERR(tcpm->tcpc.fwnode);
> +	if (!tcpm->tcpc.fwnode)
> +		return -EINVAL;
>   
>   	tcpm->tcpm_port = tcpm_register_port(tcpm->dev, &tcpm->tcpc);
>   	if (IS_ERR(tcpm->tcpm_port)) {

Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

      parent reply	other threads:[~2023-07-25 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 12:53 [PATCH] usb: typec: qcom: fix return value check in qcom_pmic_typec_probe() Yang Yingliang
2023-07-25 13:17 ` Konrad Dybcio
2023-07-25 14:18 ` Guenter Roeck
2023-07-25 14:35 ` Bryan O'Donoghue [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=e26e1738-73fb-77e0-3600-063ef5b9e083@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --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