Commit da6d91ed authored by Yang Yingliang's avatar Yang Yingliang Committed by Greg Kroah-Hartman
Browse files

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: a4422ff2 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Acked-by: default avatarKonrad Dybcio <konrad.dybcio@linaro.org>
Acked-by: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230725125319.565733-1-yangyingliang@huawei.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8291be6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)) {