diff options
Diffstat (limited to 'drivers/hid/wacom_sys.c')
| -rw-r--r-- | drivers/hid/wacom_sys.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 5dd2640c7f21..af2801df14ed 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c | |||
| @@ -1403,7 +1403,6 @@ static void wacom_clean_inputs(struct wacom *wacom) | |||
| 1403 | wacom->wacom_wac.pen_registered = false; | 1403 | wacom->wacom_wac.pen_registered = false; |
| 1404 | wacom->wacom_wac.touch_registered = false; | 1404 | wacom->wacom_wac.touch_registered = false; |
| 1405 | wacom->wacom_wac.pad_registered = false; | 1405 | wacom->wacom_wac.pad_registered = false; |
| 1406 | wacom_destroy_leds(wacom); | ||
| 1407 | } | 1406 | } |
| 1408 | 1407 | ||
| 1409 | static int wacom_allocate_inputs(struct wacom *wacom) | 1408 | static int wacom_allocate_inputs(struct wacom *wacom) |
| @@ -1475,18 +1474,10 @@ static int wacom_register_inputs(struct wacom *wacom) | |||
| 1475 | if (error) | 1474 | if (error) |
| 1476 | goto fail_register_pad_input; | 1475 | goto fail_register_pad_input; |
| 1477 | wacom_wac->pad_registered = true; | 1476 | wacom_wac->pad_registered = true; |
| 1478 | |||
| 1479 | error = wacom_initialize_leds(wacom); | ||
| 1480 | if (error) | ||
| 1481 | goto fail_leds; | ||
| 1482 | } | 1477 | } |
| 1483 | 1478 | ||
| 1484 | return 0; | 1479 | return 0; |
| 1485 | 1480 | ||
| 1486 | fail_leds: | ||
| 1487 | input_unregister_device(pad_input_dev); | ||
| 1488 | pad_input_dev = NULL; | ||
| 1489 | wacom_wac->pad_registered = false; | ||
| 1490 | fail_register_pad_input: | 1481 | fail_register_pad_input: |
| 1491 | if (touch_input_dev) | 1482 | if (touch_input_dev) |
| 1492 | input_unregister_device(touch_input_dev); | 1483 | input_unregister_device(touch_input_dev); |
| @@ -1680,6 +1671,10 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless) | |||
| 1680 | goto fail_register_inputs; | 1671 | goto fail_register_inputs; |
| 1681 | 1672 | ||
| 1682 | if (wacom->wacom_wac.features.device_type & WACOM_DEVICETYPE_PAD) { | 1673 | if (wacom->wacom_wac.features.device_type & WACOM_DEVICETYPE_PAD) { |
| 1674 | error = wacom_initialize_leds(wacom); | ||
| 1675 | if (error) | ||
| 1676 | goto fail_leds; | ||
| 1677 | |||
| 1683 | error = wacom_initialize_remote(wacom); | 1678 | error = wacom_initialize_remote(wacom); |
| 1684 | if (error) | 1679 | if (error) |
| 1685 | goto fail_remote; | 1680 | goto fail_remote; |
| @@ -1732,6 +1727,8 @@ fail_quirks: | |||
| 1732 | fail_hw_start: | 1727 | fail_hw_start: |
| 1733 | kobject_put(wacom->remote_dir); | 1728 | kobject_put(wacom->remote_dir); |
| 1734 | fail_remote: | 1729 | fail_remote: |
| 1730 | wacom_destroy_leds(wacom); | ||
| 1731 | fail_leds: | ||
| 1735 | wacom_clean_inputs(wacom); | 1732 | wacom_clean_inputs(wacom); |
| 1736 | fail_register_inputs: | 1733 | fail_register_inputs: |
| 1737 | wacom_destroy_battery(wacom); | 1734 | wacom_destroy_battery(wacom); |
| @@ -1765,12 +1762,14 @@ static void wacom_wireless_work(struct work_struct *work) | |||
| 1765 | hdev1 = usb_get_intfdata(usbdev->config->interface[1]); | 1762 | hdev1 = usb_get_intfdata(usbdev->config->interface[1]); |
| 1766 | wacom1 = hid_get_drvdata(hdev1); | 1763 | wacom1 = hid_get_drvdata(hdev1); |
| 1767 | wacom_wac1 = &(wacom1->wacom_wac); | 1764 | wacom_wac1 = &(wacom1->wacom_wac); |
| 1765 | wacom_destroy_leds(wacom1); | ||
| 1768 | wacom_clean_inputs(wacom1); | 1766 | wacom_clean_inputs(wacom1); |
| 1769 | 1767 | ||
| 1770 | /* Touch interface */ | 1768 | /* Touch interface */ |
| 1771 | hdev2 = usb_get_intfdata(usbdev->config->interface[2]); | 1769 | hdev2 = usb_get_intfdata(usbdev->config->interface[2]); |
| 1772 | wacom2 = hid_get_drvdata(hdev2); | 1770 | wacom2 = hid_get_drvdata(hdev2); |
| 1773 | wacom_wac2 = &(wacom2->wacom_wac); | 1771 | wacom_wac2 = &(wacom2->wacom_wac); |
| 1772 | wacom_destroy_leds(wacom2); | ||
| 1774 | wacom_clean_inputs(wacom2); | 1773 | wacom_clean_inputs(wacom2); |
| 1775 | 1774 | ||
| 1776 | if (wacom_wac->pid == 0) { | 1775 | if (wacom_wac->pid == 0) { |
| @@ -1825,7 +1824,9 @@ static void wacom_wireless_work(struct work_struct *work) | |||
| 1825 | return; | 1824 | return; |
| 1826 | 1825 | ||
| 1827 | fail: | 1826 | fail: |
| 1827 | wacom_destroy_leds(wacom1); | ||
| 1828 | wacom_clean_inputs(wacom1); | 1828 | wacom_clean_inputs(wacom1); |
| 1829 | wacom_destroy_leds(wacom2); | ||
| 1829 | wacom_clean_inputs(wacom2); | 1830 | wacom_clean_inputs(wacom2); |
| 1830 | return; | 1831 | return; |
| 1831 | } | 1832 | } |
| @@ -1913,6 +1914,7 @@ static void wacom_remove(struct hid_device *hdev) | |||
| 1913 | 1914 | ||
| 1914 | cancel_work_sync(&wacom->work); | 1915 | cancel_work_sync(&wacom->work); |
| 1915 | kobject_put(wacom->remote_dir); | 1916 | kobject_put(wacom->remote_dir); |
| 1917 | wacom_destroy_leds(wacom); | ||
| 1916 | wacom_clean_inputs(wacom); | 1918 | wacom_clean_inputs(wacom); |
| 1917 | if (hdev->bus == BUS_BLUETOOTH) | 1919 | if (hdev->bus == BUS_BLUETOOTH) |
| 1918 | device_remove_file(&hdev->dev, &dev_attr_speed); | 1920 | device_remove_file(&hdev->dev, &dev_attr_speed); |
