diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2018-03-19 21:53:28 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-04-26 14:33:35 +0200 |
commit | 69934012f394d1db11c3c0c781fd88b6ae447dbe (patch) | |
tree | dfbd70cd8a310020bfd04c3b1f05d03fba34f8cc /drivers/hid | |
parent | edb6cb3d7c9026d1a3bdfde9f74ed6c807285206 (diff) | |
download | linux-stable-69934012f394d1db11c3c0c781fd88b6ae447dbe.tar.gz linux-stable-69934012f394d1db11c3c0c781fd88b6ae447dbe.tar.bz2 linux-stable-69934012f394d1db11c3c0c781fd88b6ae447dbe.zip |
HID: alps: Check errors returned by 't4_read_write_register()'
If only the first 't4_read_write_register()' call fails, the error code
will be overwritten and lost.
Directly report the error instead.
While at it, log some errors if 't4_read_write_register()' fails, as done
in the rest of the driver.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-alps.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c index fe8a0624d5e4..b7091507c33f 100644 --- a/drivers/hid/hid-alps.c +++ b/drivers/hid/hid-alps.c @@ -460,17 +460,35 @@ static int __maybe_unused alps_post_reset(struct hid_device *hdev) case T4: ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_1, NULL, T4_I2C_ABS, false); + if (ret < 0) { + dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_1 (%d)\n", + ret); + goto exit; + } + ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_4, NULL, T4_FEEDCFG4_ADVANCED_ABS_ENABLE, false); + if (ret < 0) { + dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_4 (%d)\n", + ret); + goto exit; + } break; case U1: ret = u1_read_write_register(hdev, ADDRESS_U1_DEV_CTRL_1, NULL, U1_TP_ABS_MODE | U1_SP_ABS_MODE, false); + if (ret < 0) { + dev_err(&hdev->dev, "failed to change TP mode (%d)\n", + ret); + goto exit; + } break; default: break; } + +exit: return ret; } |