Re: [PATCH 1/3] usb: typec: tipd: add error message for vendor ID read failure

From: Pandey, Radhey Shyam

Date: Mon May 18 2026 - 12:05:31 EST


On 5/18/2026 3:49 PM, Heikki Krogerus wrote:
On Wed, May 13, 2026 at 11:58:48PM +0530, Radhey Shyam Pandey wrote:
Log when the vendor ID read fails or returns zero, including the I2C error
code and register value, to ease probe diagnostics.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xxxxxxx>
---
drivers/usb/typec/tipd/core.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 43faec794b95..b282366b5326 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -1744,7 +1744,7 @@ static int tps6598x_probe(struct i2c_client *client)
struct tps6598x *tps;
struct fwnode_handle *fwnode;
u32 status;
- u32 vid;
+ u32 vid = 0;

Why is this necessary?

Thanks for the review.

When ret < 0, tps6598x_read32() → tps6598x_block_read() returns on
error before writing *val. So vid is never set; passing it to
dev_err with %#x would read an uninitialized u32(random log noise).

ret captures if I2C/regmap path reported an error and vid tells what
came back when the transport layer did not fail. Hope that clarifies.

Thanks,
Radhey

int ret;
data = i2c_get_match_data(client);
@@ -1772,8 +1772,11 @@ static int tps6598x_probe(struct i2c_client *client)
if (!device_is_compatible(tps->dev, "ti,tps25750")) {
ret = tps6598x_read32(tps, TPS_REG_VID, &vid);
- if (ret < 0 || !vid)
+ if (ret < 0 || !vid) {
+ dev_err(tps->dev, "failed to read vendor ID: %d, vid: %#x\n",
+ ret, vid);
return -ENODEV;
+ }
}
/*
--
2.44.4