[PATCH] HID: i2c-hid: improve i2c_hid_get_report error message

Wentao Guan posted 1 patch 3 weeks, 5 days ago
drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] HID: i2c-hid: improve i2c_hid_get_report error message
Posted by Wentao Guan 3 weeks, 5 days ago
We have two places to print "failed to set a report to ...",
use "get a report from" instead of "set a report to", it makes
people who knows less about the module to know where the error
happened.

Before:
i2c_hid_acpi i2c-FTSC1000:00: failed to set a report to device: -11

After:
i2c_hid_acpi i2c-FTSC1000:00: failed to get a report from device: -11

Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 75544448c2393..d3912e3f2f13a 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -290,7 +290,7 @@ static int i2c_hid_get_report(struct i2c_hid *ihid,
 			     ihid->rawbuf, recv_len + sizeof(__le16));
 	if (error) {
 		dev_err(&ihid->client->dev,
-			"failed to set a report to device: %d\n", error);
+			"failed to get a report from device: %d\n", error);
 		return error;
 	}
 
-- 
2.20.1
Re: [PATCH] HID: i2c-hid: improve i2c_hid_get_report error message
Posted by Jiri Kosina 1 week ago
On Fri, 14 Feb 2025, Wentao Guan wrote:

> We have two places to print "failed to set a report to ...",
> use "get a report from" instead of "set a report to", it makes
> people who knows less about the module to know where the error
> happened.
> 
> Before:
> i2c_hid_acpi i2c-FTSC1000:00: failed to set a report to device: -11
> 
> After:
> i2c_hid_acpi i2c-FTSC1000:00: failed to get a report from device: -11
> 
> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs