]> git.itanic.dy.fi Git - linux-stable/commit
HID: i2c-hid: Switch i2c_hid_parse() to goto style error handling
authorHans de Goede <hdegoede@redhat.com>
Sat, 2 Dec 2023 22:46:10 +0000 (23:46 +0100)
committerJiri Kosina <jkosina@suse.com>
Wed, 6 Dec 2023 10:48:40 +0000 (11:48 +0100)
commitaa69d6974185e9f7a552ba982540a38e34f69690
treeeca2366a4d2a49940071fac9aea1e44356772528
parent96d3098db835d58649b73a5788898bd7672a319b
HID: i2c-hid: Switch i2c_hid_parse() to goto style error handling

Switch i2c_hid_parse() to goto style error handling.

This is a preparation patch for removing the need for
I2C_HID_QUIRK_NO_IRQ_AFTER_RESET by making i2c-hid behave
more like Windows.

Note this changes the descriptor read error path to propagate
the actual i2c_hid_read_register() error code (which is always
negative) instead of hardcoding a -EIO return.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/i2c-hid/i2c-hid-core.c