Skip to contentSkip to conversation

usb: typec: tipd: Fix error code in tps6598x_probe()

PATCH In review Dan Carpenter 2 participants 2 messages May 12 – May 18

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: typec: tipd: Fix error code in tps6598x_probe()

Set the error code on these two error paths. The existing code returns success.

Fixes 77ed2f4538da ("usb: typec: tipd: Use read_power_status function in probe")
Fixes 04041fd7d6ec ("usb: typec: tipd: Read data status in probe and cache its value")
---
 drivers/usb/typec/tipd/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/typec/tipd/core.c +1 -0
index 43faec794b95..d0b769333bd9 100644
@@ -1835,6 +1835,7 @@ static int tps6598x_probe(struct i2c_client *client)
 		goto err_role_put;
 
 	if (status & TPS_STATUS_PLUG_PRESENT) {
+		ret = -EINVAL;
 		if (!tps6598x_read_power_status(tps))
 			goto err_unregister_port;
 		if (!tps->data->read_data_status(tps))
Signature · 1 line
2.53.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Tue, May 12, 2026 at 01:14:59PM +0300, Dan Carpenter kirjoitti:

Quoted 6 lines

Set the error code on these two error paths. The existing code returns success.

Fixes 77ed2f4538da ("usb: typec: tipd: Use read_power_status function in probe")
Fixes 04041fd7d6ec ("usb: typec: tipd: Read data status in probe and cache its value")
Quoted 18 lines
---
 drivers/usb/typec/tipd/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/typec/tipd/core.c +1 -0
index 43faec794b95..d0b769333bd9 100644
@@ -1835,6 +1835,7 @@ static int tps6598x_probe(struct i2c_client *client)
 		goto err_role_put;
 
 	if (status & TPS_STATUS_PLUG_PRESENT) {
+		ret = -EINVAL;
 		if (!tps6598x_read_power_status(tps))
 			goto err_unregister_port;
 		if (!tps->data->read_data_status(tps))
Signature · 1 line
2.53.0
Signature · 1 line
heikki