diff mbox series

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

Message ID 20201021143305.475182-1-coiby.xu@gmail.com
State Accepted
Commit afdd34c5fa4028976ee5103ac499edbddedc813e
Headers show
Series HID: i2c-hid: show the error of failing to fetch the HID Descriptor | expand

Commit Message

Coiby Xu Oct. 21, 2020, 2:33 p.m. UTC
i2c_hid_probe should notify the user of the error of failing to fetch
the HID Descriptor instead of silently exiting.

Link: https://forum.manjaro.org/t/elan-touchpad-working-in-live-but-not-in-native-os/31860/55
Cc: Barnabás Pőcze <pobrn@protonmail.com>
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Jiri Kosina Oct. 29, 2020, 3:11 p.m. UTC | #1
On Wed, 21 Oct 2020, Coiby Xu wrote:

> i2c_hid_probe should notify the user of the error of failing to fetch
> the HID Descriptor instead of silently exiting.
> 
> Link: https://forum.manjaro.org/t/elan-touchpad-working-in-live-but-not-in-native-os/31860/55
> Cc: Barnabás Pőcze <pobrn@protonmail.com>
> Signed-off-by: Coiby Xu <coiby.xu@gmail.com>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 786e3e9af1c9..577d324be16d 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -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)