Commit 85d2c77b authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Jiri Kosina

HID: wacom: untie leds from inputs

Like remotes, LEDs should be handled by themself, not magically behind
the inputs as they have a complete different life.
Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: default avatarPing Cheng <pingc@wacom.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent b62f6465
...@@ -1403,7 +1403,6 @@ static void wacom_clean_inputs(struct wacom *wacom) ...@@ -1403,7 +1403,6 @@ static void wacom_clean_inputs(struct wacom *wacom)
wacom->wacom_wac.pen_registered = false; wacom->wacom_wac.pen_registered = false;
wacom->wacom_wac.touch_registered = false; wacom->wacom_wac.touch_registered = false;
wacom->wacom_wac.pad_registered = false; wacom->wacom_wac.pad_registered = false;
wacom_destroy_leds(wacom);
} }
static int wacom_allocate_inputs(struct wacom *wacom) static int wacom_allocate_inputs(struct wacom *wacom)
...@@ -1475,18 +1474,10 @@ static int wacom_register_inputs(struct wacom *wacom) ...@@ -1475,18 +1474,10 @@ static int wacom_register_inputs(struct wacom *wacom)
if (error) if (error)
goto fail_register_pad_input; goto fail_register_pad_input;
wacom_wac->pad_registered = true; wacom_wac->pad_registered = true;
error = wacom_initialize_leds(wacom);
if (error)
goto fail_leds;
} }
return 0; return 0;
fail_leds:
input_unregister_device(pad_input_dev);
pad_input_dev = NULL;
wacom_wac->pad_registered = false;
fail_register_pad_input: fail_register_pad_input:
if (touch_input_dev) if (touch_input_dev)
input_unregister_device(touch_input_dev); input_unregister_device(touch_input_dev);
...@@ -1680,6 +1671,10 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless) ...@@ -1680,6 +1671,10 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
goto fail_register_inputs; goto fail_register_inputs;
if (wacom->wacom_wac.features.device_type & WACOM_DEVICETYPE_PAD) { if (wacom->wacom_wac.features.device_type & WACOM_DEVICETYPE_PAD) {
error = wacom_initialize_leds(wacom);
if (error)
goto fail_leds;
error = wacom_initialize_remote(wacom); error = wacom_initialize_remote(wacom);
if (error) if (error)
goto fail_remote; goto fail_remote;
...@@ -1732,6 +1727,8 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless) ...@@ -1732,6 +1727,8 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
fail_hw_start: fail_hw_start:
kobject_put(wacom->remote_dir); kobject_put(wacom->remote_dir);
fail_remote: fail_remote:
wacom_destroy_leds(wacom);
fail_leds:
wacom_clean_inputs(wacom); wacom_clean_inputs(wacom);
fail_register_inputs: fail_register_inputs:
wacom_destroy_battery(wacom); wacom_destroy_battery(wacom);
...@@ -1765,12 +1762,14 @@ static void wacom_wireless_work(struct work_struct *work) ...@@ -1765,12 +1762,14 @@ static void wacom_wireless_work(struct work_struct *work)
hdev1 = usb_get_intfdata(usbdev->config->interface[1]); hdev1 = usb_get_intfdata(usbdev->config->interface[1]);
wacom1 = hid_get_drvdata(hdev1); wacom1 = hid_get_drvdata(hdev1);
wacom_wac1 = &(wacom1->wacom_wac); wacom_wac1 = &(wacom1->wacom_wac);
wacom_destroy_leds(wacom1);
wacom_clean_inputs(wacom1); wacom_clean_inputs(wacom1);
/* Touch interface */ /* Touch interface */
hdev2 = usb_get_intfdata(usbdev->config->interface[2]); hdev2 = usb_get_intfdata(usbdev->config->interface[2]);
wacom2 = hid_get_drvdata(hdev2); wacom2 = hid_get_drvdata(hdev2);
wacom_wac2 = &(wacom2->wacom_wac); wacom_wac2 = &(wacom2->wacom_wac);
wacom_destroy_leds(wacom2);
wacom_clean_inputs(wacom2); wacom_clean_inputs(wacom2);
if (wacom_wac->pid == 0) { if (wacom_wac->pid == 0) {
...@@ -1825,7 +1824,9 @@ static void wacom_wireless_work(struct work_struct *work) ...@@ -1825,7 +1824,9 @@ static void wacom_wireless_work(struct work_struct *work)
return; return;
fail: fail:
wacom_destroy_leds(wacom1);
wacom_clean_inputs(wacom1); wacom_clean_inputs(wacom1);
wacom_destroy_leds(wacom2);
wacom_clean_inputs(wacom2); wacom_clean_inputs(wacom2);
return; return;
} }
...@@ -1913,6 +1914,7 @@ static void wacom_remove(struct hid_device *hdev) ...@@ -1913,6 +1914,7 @@ static void wacom_remove(struct hid_device *hdev)
cancel_work_sync(&wacom->work); cancel_work_sync(&wacom->work);
kobject_put(wacom->remote_dir); kobject_put(wacom->remote_dir);
wacom_destroy_leds(wacom);
wacom_clean_inputs(wacom); wacom_clean_inputs(wacom);
if (hdev->bus == BUS_BLUETOOTH) if (hdev->bus == BUS_BLUETOOTH)
device_remove_file(&hdev->dev, &dev_attr_speed); device_remove_file(&hdev->dev, &dev_attr_speed);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment