Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2018-04-19 09:25:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-24 09:43:10 +0200
commitb74dc8c00232ca556cdf3c6ae2dc2140f279cf89 (patch)
treea298d32c7907e508f29bb5cd1369ebd02ba2f5b8
parent92496da88e471ec52a2ba8920b09403d86ee3ddd (diff)
HID: i2c-hid: fix inverted return value from i2c_hid_command()
commit b658912cb023cd6f8e46963d29779903d3c10538 upstream. i2c_hid_command() returns non-zero in error cases (the actual errno). Error handling in for I2C_HID_QUIRK_RESEND_REPORT_DESCR case in i2c_hid_resume() had the check inverted; fix that. Fixes: 3e83eda467 ("HID: i2c-hid: Fix resume issue on Raydium touchscreen device") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Cc: Aaron Ma <aaron.ma@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index de8714c07fd7..fd9f70a8b813 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1229,7 +1229,7 @@ static int i2c_hid_resume(struct device *dev)
*/
if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) {
ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0);
- if (!ret)
+ if (ret)
return ret;
}