Skip to content

Commit

Permalink
HID: wacom: move allocation of inputs earlier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Oct 1, 2014
1 parent 2546dac commit 494078b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,12 @@ static int wacom_probe(struct hid_device *hdev,
mutex_init(&wacom->lock);
INIT_WORK(&wacom->work, wacom_wireless_work);

if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) {
error = wacom_allocate_inputs(wacom);
if (error)
goto fail_allocate_inputs;
}

/* set the default size in case we do not get them from hid */
wacom_set_default_phy(features);

Expand Down Expand Up @@ -1429,8 +1435,7 @@ static int wacom_probe(struct hid_device *hdev,
}

if (!(features->quirks & WACOM_QUIRK_NO_INPUT)) {
error = wacom_allocate_inputs(wacom) ||
wacom_register_inputs(wacom);
error = wacom_register_inputs(wacom);
if (error)
goto fail_register_inputs;
}
Expand Down Expand Up @@ -1464,7 +1469,6 @@ static int wacom_probe(struct hid_device *hdev,
return 0;

fail_hw_start:
wacom_clean_inputs(wacom);
if (hdev->bus == BUS_BLUETOOTH)
device_remove_file(&hdev->dev, &dev_attr_speed);
fail_register_inputs:
Expand All @@ -1473,6 +1477,8 @@ static int wacom_probe(struct hid_device *hdev,
fail_battery:
wacom_remove_shared_data(wacom_wac);
fail_shared_data:
wacom_clean_inputs(wacom);
fail_allocate_inputs:
fail_type:
fail_pktlen:
fail_parse:
Expand Down

0 comments on commit 494078b

Please sign in to comment.