usb: typec: qcom: fix return value check in qcom_pmic_typec_probe()

device_get_named_child_node() returns NULL, if it fails, replace
IS_ERR() with NULL pointer check.

Fixes: a4422ff221 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230725125319.565733-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yang Yingliang 2023-07-25 20:53:19 +08:00 committed by Greg Kroah-Hartman
parent a8291be6b5
commit da6d91ed77

View file

@ -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)) {