diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-09-23 12:08:07 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-10-01 03:11:22 -0400 |
commit | 494078b0bb578c4cf1e00275dd3224d793013488 (patch) | |
tree | ec7648e0f25ffeba1fe4631bdf4748f8406030c3 /drivers/hid/wacom_sys.c | |
parent | 2546dacd3e0e48c40bbb99caf01455f1ade9bb24 (diff) |
HID: wacom: move allocation of inputs earlier
This allows to have the input devices ready in while parsing the reports
descriptor.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom_sys.c')
-rw-r--r-- | drivers/hid/wacom_sys.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 62f3c899ab98..21ac2baa21be 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c | |||
@@ -1357,6 +1357,12 @@ static int wacom_probe(struct hid_device *hdev, | |||
1357 | mutex_init(&wacom->lock); | 1357 | mutex_init(&wacom->lock); |
1358 | INIT_WORK(&wacom->work, wacom_wireless_work); | 1358 | INIT_WORK(&wacom->work, wacom_wireless_work); |
1359 | 1359 | ||
1360 | if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) { | ||
1361 | error = wacom_allocate_inputs(wacom); | ||
1362 | if (error) | ||
1363 | goto fail_allocate_inputs; | ||
1364 | } | ||
1365 | |||
1360 | /* set the default size in case we do not get them from hid */ | 1366 | /* set the default size in case we do not get them from hid */ |
1361 | wacom_set_default_phy(features); | 1367 | wacom_set_default_phy(features); |
1362 | 1368 | ||
@@ -1429,8 +1435,7 @@ static int wacom_probe(struct hid_device *hdev, | |||
1429 | } | 1435 | } |
1430 | 1436 | ||
1431 | if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) { | 1437 | if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) { |
1432 | error = wacom_allocate_inputs(wacom) || | 1438 | error = wacom_register_inputs(wacom); |
1433 | wacom_register_inputs(wacom); | ||
1434 | if (error) | 1439 | if (error) |
1435 | goto fail_register_inputs; | 1440 | goto fail_register_inputs; |
1436 | } | 1441 | } |
@@ -1464,7 +1469,6 @@ static int wacom_probe(struct hid_device *hdev, | |||
1464 | return 0; | 1469 | return 0; |
1465 | 1470 | ||
1466 | fail_hw_start: | 1471 | fail_hw_start: |
1467 | wacom_clean_inputs(wacom); | ||
1468 | if (hdev->bus == BUS_BLUETOOTH) | 1472 | if (hdev->bus == BUS_BLUETOOTH) |
1469 | device_remove_file(&hdev->dev, &dev_attr_speed); | 1473 | device_remove_file(&hdev->dev, &dev_attr_speed); |
1470 | fail_register_inputs: | 1474 | fail_register_inputs: |
@@ -1473,6 +1477,8 @@ fail_register_inputs: | |||
1473 | fail_battery: | 1477 | fail_battery: |
1474 | wacom_remove_shared_data(wacom_wac); | 1478 | wacom_remove_shared_data(wacom_wac); |
1475 | fail_shared_data: | 1479 | fail_shared_data: |
1480 | wacom_clean_inputs(wacom); | ||
1481 | fail_allocate_inputs: | ||
1476 | fail_type: | 1482 | fail_type: |
1477 | fail_pktlen: | 1483 | fail_pktlen: |
1478 | fail_parse: | 1484 | fail_parse: |