diff options
| -rw-r--r-- | drivers/hid/hid-appleir.c | 4 | ||||
| -rw-r--r-- | drivers/hid/hid-elo.c | 4 | ||||
| -rw-r--r-- | drivers/hid/hid-input.c | 10 | ||||
| -rw-r--r-- | drivers/hid/hid-lenovo.c | 4 | ||||
| -rw-r--r-- | drivers/hid/hid-logitech-hidpp.c | 4 | ||||
| -rw-r--r-- | drivers/hid/hid-magicmouse.c | 8 | ||||
| -rw-r--r-- | drivers/hid/hid-multitouch.c | 20 | ||||
| -rw-r--r-- | drivers/hid/hid-ntrig.c | 6 | ||||
| -rw-r--r-- | drivers/hid/hid-rmi.c | 11 | ||||
| -rw-r--r-- | drivers/hid/hid-sony.c | 13 | ||||
| -rw-r--r-- | drivers/hid/hid-uclogic.c | 6 | ||||
| -rw-r--r-- | include/linux/hid.h | 4 |
12 files changed, 66 insertions, 28 deletions
diff --git a/drivers/hid/hid-appleir.c b/drivers/hid/hid-appleir.c index 0e6a42d37eb6..07cbc70f00e7 100644 --- a/drivers/hid/hid-appleir.c +++ b/drivers/hid/hid-appleir.c | |||
| @@ -256,7 +256,7 @@ out: | |||
| 256 | return 0; | 256 | return 0; |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | static void appleir_input_configured(struct hid_device *hid, | 259 | static int appleir_input_configured(struct hid_device *hid, |
| 260 | struct hid_input *hidinput) | 260 | struct hid_input *hidinput) |
| 261 | { | 261 | { |
| 262 | struct input_dev *input_dev = hidinput->input; | 262 | struct input_dev *input_dev = hidinput->input; |
| @@ -275,6 +275,8 @@ static void appleir_input_configured(struct hid_device *hid, | |||
| 275 | for (i = 0; i < ARRAY_SIZE(appleir_key_table); i++) | 275 | for (i = 0; i < ARRAY_SIZE(appleir_key_table); i++) |
| 276 | set_bit(appleir->keymap[i], input_dev->keybit); | 276 | set_bit(appleir->keymap[i], input_dev->keybit); |
| 277 | clear_bit(KEY_RESERVED, input_dev->keybit); | 277 | clear_bit(KEY_RESERVED, input_dev->keybit); |
| 278 | |||
| 279 | return 0; | ||
| 278 | } | 280 | } |
| 279 | 281 | ||
| 280 | static int appleir_input_mapping(struct hid_device *hid, | 282 | static int appleir_input_mapping(struct hid_device *hid, |
diff --git a/drivers/hid/hid-elo.c b/drivers/hid/hid-elo.c index 4e49462870ab..aad8c162a825 100644 --- a/drivers/hid/hid-elo.c +++ b/drivers/hid/hid-elo.c | |||
| @@ -37,7 +37,7 @@ static bool use_fw_quirk = true; | |||
| 37 | module_param(use_fw_quirk, bool, S_IRUGO); | 37 | module_param(use_fw_quirk, bool, S_IRUGO); |
| 38 | MODULE_PARM_DESC(use_fw_quirk, "Do periodic pokes for broken M firmwares (default = true)"); | 38 | MODULE_PARM_DESC(use_fw_quirk, "Do periodic pokes for broken M firmwares (default = true)"); |
| 39 | 39 | ||
| 40 | static void elo_input_configured(struct hid_device *hdev, | 40 | static int elo_input_configured(struct hid_device *hdev, |
| 41 | struct hid_input *hidinput) | 41 | struct hid_input *hidinput) |
| 42 | { | 42 | { |
| 43 | struct input_dev *input = hidinput->input; | 43 | struct input_dev *input = hidinput->input; |
| @@ -45,6 +45,8 @@ static void elo_input_configured(struct hid_device *hdev, | |||
| 45 | set_bit(BTN_TOUCH, input->keybit); | 45 | set_bit(BTN_TOUCH, input->keybit); |
| 46 | set_bit(ABS_PRESSURE, input->absbit); | 46 | set_bit(ABS_PRESSURE, input->absbit); |
| 47 | input_set_abs_params(input, ABS_PRESSURE, 0, 256, 0, 0); | 47 | input_set_abs_params(input, ABS_PRESSURE, 0, 256, 0, 0); |
| 48 | |||
| 49 | return 0; | ||
| 48 | } | 50 | } |
| 49 | 51 | ||
| 50 | static void elo_process_data(struct input_dev *input, const u8 *data, int size) | 52 | static void elo_process_data(struct input_dev *input, const u8 *data, int size) |
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 | } |
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c index e4bc6cb6d7fa..8979f1fd5208 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c | |||
| @@ -848,7 +848,7 @@ static void lenovo_remove(struct hid_device *hdev) | |||
| 848 | hid_hw_stop(hdev); | 848 | hid_hw_stop(hdev); |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | static void lenovo_input_configured(struct hid_device *hdev, | 851 | static int lenovo_input_configured(struct hid_device *hdev, |
| 852 | struct hid_input *hi) | 852 | struct hid_input *hi) |
| 853 | { | 853 | { |
| 854 | switch (hdev->product) { | 854 | switch (hdev->product) { |
| @@ -863,6 +863,8 @@ static void lenovo_input_configured(struct hid_device *hdev, | |||
| 863 | } | 863 | } |
| 864 | break; | 864 | break; |
| 865 | } | 865 | } |
| 866 | |||
| 867 | return 0; | ||
| 866 | } | 868 | } |
| 867 | 869 | ||
| 868 | 870 | ||
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 484196459305..a25f562f2d7b 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c | |||
| @@ -1160,13 +1160,15 @@ static void hidpp_populate_input(struct hidpp_device *hidpp, | |||
| 1160 | m560_populate_input(hidpp, input, origin_is_hid_core); | 1160 | m560_populate_input(hidpp, input, origin_is_hid_core); |
| 1161 | } | 1161 | } |
| 1162 | 1162 | ||
| 1163 | static void hidpp_input_configured(struct hid_device *hdev, | 1163 | static int hidpp_input_configured(struct hid_device *hdev, |
| 1164 | struct hid_input *hidinput) | 1164 | struct hid_input *hidinput) |
| 1165 | { | 1165 | { |
| 1166 | struct hidpp_device *hidpp = hid_get_drvdata(hdev); | 1166 | struct hidpp_device *hidpp = hid_get_drvdata(hdev); |
| 1167 | struct input_dev *input = hidinput->input; | 1167 | struct input_dev *input = hidinput->input; |
| 1168 | 1168 | ||
| 1169 | hidpp_populate_input(hidpp, input, true); | 1169 | hidpp_populate_input(hidpp, input, true); |
| 1170 | |||
| 1171 | return 0; | ||
| 1170 | } | 1172 | } |
| 1171 | 1173 | ||
| 1172 | static int hidpp_raw_hidpp_event(struct hidpp_device *hidpp, u8 *data, | 1174 | static int hidpp_raw_hidpp_event(struct hidpp_device *hidpp, u8 *data, |
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 29a74c1efcb8..d6fa496d0ca2 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c | |||
| @@ -471,18 +471,22 @@ static int magicmouse_input_mapping(struct hid_device *hdev, | |||
| 471 | return 0; | 471 | return 0; |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | static void magicmouse_input_configured(struct hid_device *hdev, | 474 | static int magicmouse_input_configured(struct hid_device *hdev, |
| 475 | struct hid_input *hi) | 475 | struct hid_input *hi) |
| 476 | 476 | ||
| 477 | { | 477 | { |
| 478 | struct magicmouse_sc *msc = hid_get_drvdata(hdev); | 478 | struct magicmouse_sc *msc = hid_get_drvdata(hdev); |
| 479 | int ret; | ||
| 479 | 480 | ||
| 480 | int ret = magicmouse_setup_input(msc->input, hdev); | 481 | ret = magicmouse_setup_input(msc->input, hdev); |
| 481 | if (ret) { | 482 | if (ret) { |
| 482 | hid_err(hdev, "magicmouse setup input failed (%d)\n", ret); | 483 | hid_err(hdev, "magicmouse setup input failed (%d)\n", ret); |
| 483 | /* clean msc->input to notify probe() of the failure */ | 484 | /* clean msc->input to notify probe() of the failure */ |
| 484 | msc->input = NULL; | 485 | msc->input = NULL; |
| 486 | return ret; | ||
| 485 | } | 487 | } |
| 488 | |||
| 489 | return 0; | ||
| 486 | } | 490 | } |
| 487 | 491 | ||
| 488 | 492 | ||
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 426b2f1a3450..2ed42d8f805b 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
| @@ -725,12 +725,13 @@ static void mt_touch_report(struct hid_device *hid, struct hid_report *report) | |||
| 725 | mt_sync_frame(td, report->field[0]->hidinput->input); | 725 | mt_sync_frame(td, report->field[0]->hidinput->input); |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | static void mt_touch_input_configured(struct hid_device *hdev, | 728 | static int mt_touch_input_configured(struct hid_device *hdev, |
| 729 | struct hid_input *hi) | 729 | struct hid_input *hi) |
| 730 | { | 730 | { |
| 731 | struct mt_device *td = hid_get_drvdata(hdev); | 731 | struct mt_device *td = hid_get_drvdata(hdev); |
| 732 | struct mt_class *cls = &td->mtclass; | 732 | struct mt_class *cls = &td->mtclass; |
| 733 | struct input_dev *input = hi->input; | 733 | struct input_dev *input = hi->input; |
| 734 | int ret; | ||
| 734 | 735 | ||
| 735 | if (!td->maxcontacts) | 736 | if (!td->maxcontacts) |
| 736 | td->maxcontacts = MT_DEFAULT_MAXCONTACT; | 737 | td->maxcontacts = MT_DEFAULT_MAXCONTACT; |
| @@ -752,9 +753,12 @@ static void mt_touch_input_configured(struct hid_device *hdev, | |||
| 752 | if (td->is_buttonpad) | 753 | if (td->is_buttonpad) |
| 753 | __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); | 754 | __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); |
| 754 | 755 | ||
| 755 | input_mt_init_slots(input, td->maxcontacts, td->mt_flags); | 756 | ret = input_mt_init_slots(input, td->maxcontacts, td->mt_flags); |
| 757 | if (ret) | ||
