Skip to contentSkip to conversation

HID: i2c-hid: show the error of failing to fetch the HID Descriptor

PATCH Applied Coiby Xu 2 participants 2 messages Oct 21, 2020 – Oct 29, 2020 HID

lore
Share & tools
lore

Coiby Xu

author
#0 lore raw

PATCH 1/1 HID: i2c-hid: show the error of failing to fetch the HID Descriptor

i2c_hid_probe should notify the user of the error of failing to fetch the HID Descriptor instead of silently exiting.

---
 drivers/hid/i2c-hid/i2c-hid-core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid-core.c +4 -1
index 786e3e9af1c9..577d324be16d 100644
@@ -1099,8 +1099,11 @@ static int i2c_hid_probe(struct i2c_client *client,
 	}
 
 	ret = i2c_hid_fetch_hid_descriptor(ihid);
-	if (ret < 0)
+	if (ret < 0) {
+		dev_err(&client->dev,
+			"Failed to fetch the HID Descriptor\n");
 		goto err_regulator;
+	}
 
 	ret = i2c_hid_init_irq(client);
 	if (ret < 0)
Signature · 1 line
2.28.0