HID: wacom: remove cleanup of wacom->remote_dir from wacom_clean_inputs()
wacom->remote_dir has nothing to do with inputs, so better not magically removing it when cleaning inputs. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Родитель
97f9afa4f9
Коммит
b62f6465ce
|
@ -1397,7 +1397,6 @@ static void wacom_clean_inputs(struct wacom *wacom)
|
||||||
else
|
else
|
||||||
input_free_device(wacom->wacom_wac.pad_input);
|
input_free_device(wacom->wacom_wac.pad_input);
|
||||||
}
|
}
|
||||||
kobject_put(wacom->remote_dir);
|
|
||||||
wacom->wacom_wac.pen_input = NULL;
|
wacom->wacom_wac.pen_input = NULL;
|
||||||
wacom->wacom_wac.touch_input = NULL;
|
wacom->wacom_wac.touch_input = NULL;
|
||||||
wacom->wacom_wac.pad_input = NULL;
|
wacom->wacom_wac.pad_input = NULL;
|
||||||
|
@ -1480,16 +1479,10 @@ static int wacom_register_inputs(struct wacom *wacom)
|
||||||
error = wacom_initialize_leds(wacom);
|
error = wacom_initialize_leds(wacom);
|
||||||
if (error)
|
if (error)
|
||||||
goto fail_leds;
|
goto fail_leds;
|
||||||
|
|
||||||
error = wacom_initialize_remote(wacom);
|
|
||||||
if (error)
|
|
||||||
goto fail_remote;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_remote:
|
|
||||||
wacom_destroy_leds(wacom);
|
|
||||||
fail_leds:
|
fail_leds:
|
||||||
input_unregister_device(pad_input_dev);
|
input_unregister_device(pad_input_dev);
|
||||||
pad_input_dev = NULL;
|
pad_input_dev = NULL;
|
||||||
|
@ -1686,6 +1679,12 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||||
if (error)
|
if (error)
|
||||||
goto fail_register_inputs;
|
goto fail_register_inputs;
|
||||||
|
|
||||||
|
if (wacom->wacom_wac.features.device_type & WACOM_DEVICETYPE_PAD) {
|
||||||
|
error = wacom_initialize_remote(wacom);
|
||||||
|
if (error)
|
||||||
|
goto fail_remote;
|
||||||
|
}
|
||||||
|
|
||||||
if (features->type == HID_GENERIC)
|
if (features->type == HID_GENERIC)
|
||||||
connect_mask |= HID_CONNECT_DRIVER;
|
connect_mask |= HID_CONNECT_DRIVER;
|
||||||
|
|
||||||
|
@ -1705,7 +1704,7 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||||
if ((features->type == BAMBOO_TOUCH) &&
|
if ((features->type == BAMBOO_TOUCH) &&
|
||||||
(features->device_type & WACOM_DEVICETYPE_PEN)) {
|
(features->device_type & WACOM_DEVICETYPE_PEN)) {
|
||||||
error = -ENODEV;
|
error = -ENODEV;
|
||||||
goto fail_hw_start;
|
goto fail_quirks;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pen only Bamboo neither support touch nor pad */
|
/* pen only Bamboo neither support touch nor pad */
|
||||||
|
@ -1713,7 +1712,7 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||||
((features->device_type & WACOM_DEVICETYPE_TOUCH) ||
|
((features->device_type & WACOM_DEVICETYPE_TOUCH) ||
|
||||||
(features->device_type & WACOM_DEVICETYPE_PAD))) {
|
(features->device_type & WACOM_DEVICETYPE_PAD))) {
|
||||||
error = -ENODEV;
|
error = -ENODEV;
|
||||||
goto fail_hw_start;
|
goto fail_quirks;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR)
|
if (features->device_type & WACOM_DEVICETYPE_WL_MONITOR)
|
||||||
|
@ -1728,10 +1727,13 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_hw_start:
|
fail_quirks:
|
||||||
hid_hw_stop(hdev);
|
hid_hw_stop(hdev);
|
||||||
fail_register_inputs:
|
fail_hw_start:
|
||||||
|
kobject_put(wacom->remote_dir);
|
||||||
|
fail_remote:
|
||||||
wacom_clean_inputs(wacom);
|
wacom_clean_inputs(wacom);
|
||||||
|
fail_register_inputs:
|
||||||
wacom_destroy_battery(wacom);
|
wacom_destroy_battery(wacom);
|
||||||
fail_battery:
|
fail_battery:
|
||||||
wacom_remove_shared_data(wacom);
|
wacom_remove_shared_data(wacom);
|
||||||
|
@ -1910,6 +1912,7 @@ static void wacom_remove(struct hid_device *hdev)
|
||||||
hid_hw_stop(hdev);
|
hid_hw_stop(hdev);
|
||||||
|
|
||||||
cancel_work_sync(&wacom->work);
|
cancel_work_sync(&wacom->work);
|
||||||
|
kobject_put(wacom->remote_dir);
|
||||||
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);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче