[PATCH -next 3/3] usb: typec: anx7411: Fix error return code in anx7411_i2c_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add mising error return code when failed to get interrupt or failed
to register psy.

Fixes: fe6d8a9c8e64 ("usb: typec: anx7411: Add Analogix PD ANX7411 support")
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
 drivers/usb/typec/anx7411.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/typec/anx7411.c b/drivers/usb/typec/anx7411.c
index 4816f5d24ac3..c4041fd52be9 100644
--- a/drivers/usb/typec/anx7411.c
+++ b/drivers/usb/typec/anx7411.c
@@ -1483,12 +1483,14 @@ static int anx7411_i2c_probe(struct i2c_client *client,
 
 	if (!plat->intp_irq) {
 		dev_err(dev, "fail to get interrupt IRQ\n");
+		ret = -EINVAL;
 		goto free_typec_port;
 	}
 
 	plat->dev = dev;
 	plat->psy_online = ANX7411_PSY_OFFLINE;
-	if (anx7411_psy_register(plat)) {
+	ret = anx7411_psy_register(plat);
+	if (ret) {
 		dev_err(dev, "register psy\n");
 		goto free_typec_port;
 	}
-- 
2.25.1




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux