Skip to content

Commit da6d91e

Browse files
Yang Yinglianggregkh
authored andcommitted
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: a4422ff ("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>
1 parent a8291be commit da6d91e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
209209
platform_set_drvdata(pdev, tcpm);
210210

211211
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;
214214

215215
tcpm->tcpm_port = tcpm_register_port(tcpm->dev, &tcpm->tcpc);
216216
if (IS_ERR(tcpm->tcpm_port)) {

0 commit comments

Comments
 (0)