diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-09-29 18:52:59 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-09-30 04:07:09 -0400 |
commit | b2c68a2f1bab3e3d3bf4ab2b5fcd94cd37f61b41 (patch) | |
tree | b8d5fbadb77568922c5f804777bbb2aa998d9a6d /drivers/hid/hid-input.c | |
parent | 0678072755b6672b19ee0fd42748a003912fca09 (diff) |
HID: hid-input: allow input_configured callback return errors
When configuring input device via input_configured callback we may
encounter errors (for example input_mt_init_slots() may fail). Instead
of continuing with half-initialized input device let's allow driver
indicate failures.
Signed-off-by: Jaikumar Ganesh <jaikumarg@android.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Acked-by: Andrew Duggan <aduggan@synaptics.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r-- | drivers/hid/hid-input.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 53aeaf6252c7..2ba6bf69b7d0 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -1510,8 +1510,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
1510 | * UGCI) cram a lot of unrelated inputs into the | 1510 | * UGCI) cram a lot of unrelated inputs into the |
1511 | * same interface. */ | 1511 | * same interface. */ |
1512 | hidinput->report = report; | 1512 | hidinput->report = report; |
1513 | if (drv->input_configured) | 1513 | if (drv->input_configured && |
1514 | drv->input_configured(hid, hidinput); | 1514 | drv->input_configured(hid, hidinput)) |
1515 | goto out_cleanup; | ||
1515 | if (input_register_device(hidinput->input)) | 1516 | if (input_register_device(hidinput->input)) |
1516 | goto out_cleanup; | 1517 | goto out_cleanup; |
1517 | hidinput = NULL; | 1518 | hidinput = NULL; |
@@ -1532,8 +1533,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
1532 | } | 1533 | } |
1533 | 1534 | ||
1534 | if (hidinput) { | 1535 | if (hidinput) { |
1535 | if (drv->input_configured) | 1536 | if (drv->input_configured && |
1536 | drv->input_configured(hid, hidinput); | 1537 | drv->input_configured(hid, hidinput)) |
1538 | goto out_cleanup; | ||
1537 | if (input_register_device(hidinput->input)) | 1539 | if (input_register_device(hidinput->input)) |
1538 | goto out_cleanup; | 1540 | goto out_cleanup; |
1539 | } | 1541 | } |