Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: a4422ff22142 ("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>

authored by

Yang Yingliang and committed by
Greg Kroah-Hartman
da6d91ed a8291be6

+2 -2
+2 -2
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
··· 209 209 platform_set_drvdata(pdev, tcpm); 210 210 211 211 tcpm->tcpc.fwnode = device_get_named_child_node(tcpm->dev, "connector"); 212 - if (IS_ERR(tcpm->tcpc.fwnode)) 213 - return PTR_ERR(tcpm->tcpc.fwnode); 212 + if (!tcpm->tcpc.fwnode) 213 + return -EINVAL; 214 214 215 215 tcpm->tcpm_port = tcpm_register_port(tcpm->dev, &tcpm->tcpc); 216 216 if (IS_ERR(tcpm->tcpm_port)) {