From: Guenter Roeck <linux@roeck-us.net>
To: Yang Yingliang <yangyingliang@huawei.com>,
linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org
Cc: bryan.odonoghue@linaro.org, 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 07:18:39 -0700 [thread overview]
Message-ID: <8df6ac5b-46ab-bea2-4062-6bf5ce00f3ee@roeck-us.net> (raw)
In-Reply-To: <20230725125319.565733-1-yangyingliang@huawei.com>
On 7/25/23 05: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>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> 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)) {
next prev parent reply other threads:[~2023-07-25 14:21 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 [this message]
2023-07-25 14:35 ` Bryan O'Donoghue
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=8df6ac5b-46ab-bea2-4062-6bf5ce00f3ee@roeck-us.net \
--to=linux@roeck-us.net \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.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=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