Merge branch 'for-5.4/cleanup' into for-linus

- cleanup of ->drvdata handling between HID core and drivers, from
  Benjamin Tissoires

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Jiri Kosina 2019-09-22 22:30:03 +02:00
commit 7147935a0c
5 changed files with 3 additions and 20 deletions

View File

@ -207,7 +207,7 @@ static int cougar_probe(struct hid_device *hdev,
error = hid_parse(hdev); error = hid_parse(hdev);
if (error) { if (error) {
hid_err(hdev, "parse failed\n"); hid_err(hdev, "parse failed\n");
goto fail; return error;
} }
if (hdev->collection->usage == COUGAR_VENDOR_USAGE) { if (hdev->collection->usage == COUGAR_VENDOR_USAGE) {
@ -219,7 +219,7 @@ static int cougar_probe(struct hid_device *hdev,
error = hid_hw_start(hdev, connect_mask); error = hid_hw_start(hdev, connect_mask);
if (error) { if (error) {
hid_err(hdev, "hw start failed\n"); hid_err(hdev, "hw start failed\n");
goto fail; return error;
} }
error = cougar_bind_shared_data(hdev, cougar); error = cougar_bind_shared_data(hdev, cougar);
@ -249,8 +249,6 @@ static int cougar_probe(struct hid_device *hdev,
fail_stop_and_cleanup: fail_stop_and_cleanup:
hid_hw_stop(hdev); hid_hw_stop(hdev);
fail:
hid_set_drvdata(hdev, NULL);
return error; return error;
} }

View File

@ -123,12 +123,6 @@ done:
return ret; return ret;
} }
static void gfrm_remove(struct hid_device *hdev)
{
hid_hw_stop(hdev);
hid_set_drvdata(hdev, NULL);
}
static const struct hid_device_id gfrm_devices[] = { static const struct hid_device_id gfrm_devices[] = {
{ HID_BLUETOOTH_DEVICE(0x58, 0x2000), { HID_BLUETOOTH_DEVICE(0x58, 0x2000),
.driver_data = GFRM100 }, .driver_data = GFRM100 },
@ -142,7 +136,6 @@ static struct hid_driver gfrm_driver = {
.name = "gfrm", .name = "gfrm",
.id_table = gfrm_devices, .id_table = gfrm_devices,
.probe = gfrm_probe, .probe = gfrm_probe,
.remove = gfrm_remove,
.input_mapping = gfrm_input_mapping, .input_mapping = gfrm_input_mapping,
.raw_event = gfrm_raw_event, .raw_event = gfrm_raw_event,
.input_configured = gfrm_input_configured, .input_configured = gfrm_input_configured,

View File

@ -866,8 +866,6 @@ static void lenovo_remove_tpkbd(struct hid_device *hdev)
led_classdev_unregister(&data_pointer->led_micmute); led_classdev_unregister(&data_pointer->led_micmute);
led_classdev_unregister(&data_pointer->led_mute); led_classdev_unregister(&data_pointer->led_mute);
hid_set_drvdata(hdev, NULL);
} }
static void lenovo_remove_cptkbd(struct hid_device *hdev) static void lenovo_remove_cptkbd(struct hid_device *hdev)

View File

@ -534,8 +534,7 @@ static int picolcd_probe(struct hid_device *hdev,
data = kzalloc(sizeof(struct picolcd_data), GFP_KERNEL); data = kzalloc(sizeof(struct picolcd_data), GFP_KERNEL);
if (data == NULL) { if (data == NULL) {
hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n"); hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n");
error = -ENOMEM; return -ENOMEM;
goto err_no_cleanup;
} }
spin_lock_init(&data->lock); spin_lock_init(&data->lock);
@ -597,9 +596,6 @@ err_cleanup_hid_hw:
hid_hw_stop(hdev); hid_hw_stop(hdev);
err_cleanup_data: err_cleanup_data:
kfree(data); kfree(data);
err_no_cleanup:
hid_set_drvdata(hdev, NULL);
return error; return error;
} }
@ -635,7 +631,6 @@ static void picolcd_remove(struct hid_device *hdev)
picolcd_exit_cir(data); picolcd_exit_cir(data);
picolcd_exit_keys(data); picolcd_exit_keys(data);
hid_set_drvdata(hdev, NULL);
mutex_destroy(&data->mutex); mutex_destroy(&data->mutex);
/* Finally, clean up the picolcd data itself */ /* Finally, clean up the picolcd data itself */
kfree(data); kfree(data);

View File

@ -742,7 +742,6 @@ static void sensor_hub_remove(struct hid_device *hdev)
} }
spin_unlock_irqrestore(&data->lock, flags); spin_unlock_irqrestore(&data->lock, flags);
mfd_remove_devices(&hdev->dev); mfd_remove_devices(&hdev->dev);
hid_set_drvdata(hdev, NULL);
mutex_destroy(&data->mutex); mutex_destroy(&data->mutex);
} }