mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
usb: typec: tipd: add error message for vendor ID read failure
Log an error when the vendor ID read fails or returns zero, including the I2C error code and register value, and initialize the vendor ID variable to avoid logging an uninitialized value on read failure. Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://patch.msgid.link/0aa487d3f054b34689e95760fefd72f7571f64c9.1779214249.git.radhey.shyam.pandey@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cfdc9bde49
commit
fe0f370af9
|
|
@ -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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user