HID: logitech-dj: Really fix return value of logi_dj_recv_query_hidpp_devices
authorHans de Goede <hdegoede@redhat.com>
Mon, 29 Jul 2019 15:50:36 +0000 (17:50 +0200)
committerJiri Kosina <jkosina@suse.cz>
Mon, 5 Aug 2019 10:49:28 +0000 (12:49 +0200)
commit6fb08f1a5f7e5cdde1ce00104788e602f4299b99
tree6ef35115af5ac1e1f35728358782920a527f2410
parent65f11c72780fa9d598df88def045ccb6a885cf80
HID: logitech-dj: Really fix return value of logi_dj_recv_query_hidpp_devices

Commit dbcbabf7da92 ("HID: logitech-dj: fix return value of
logi_dj_recv_query_hidpp_devices") made logi_dj_recv_query_hidpp_devices
return the return value of hid_hw_raw_request instead of unconditionally
returning 0.

But hid_hw_raw_request returns the report-size on a successful request
(and a negative error-code on failure) where as the callers of
logi_dj_recv_query_hidpp_devices expect a 0 return on success.

This commit fixes things so that either the negative error gets returned
or 0 on success, fixing HID++ receivers such as the Logitech nano receivers
no longer working.

Cc: YueHaibing <yuehaibing@huawei.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: dbcbabf7da92 ("HID: logitech-dj: fix return value of logi_dj_recv_query_hidpp_devices")
Reported-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Rafael J. Wysocki <rjw@rjwysocki.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Rafael J. Wysocki <rjw@rjwysocki.net>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Tested-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-logitech-dj.c