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 <[email protected]> Acked-by: Konrad Dybcio <[email protected]> Acked-by: Bryan O'Donoghue <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
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)