[PATCH v2 1/6] platform/x86/tuxedo: Don't use device driver data
Aaron Erhardt <[email protected]> Tue, 28 Jul 2026 14:26:33 +0200
| Newsgroups | org.kernel.vger.platform-driver-x86,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The WMI driver for TUXEDO Sirius devices used to rely on the device driver data through dev_set_drvdata even though it is only a virtual low level HID driver. For this purpose, it is better to use the driver_data of the hid_device struct to avoid interfering with high level device drivers. Signed-off-by: Aaron Erhardt <[email protected]> --- drivers/platform/x86/tuxedo/nb04/wmi_ab.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/tuxedo/nb04/wmi_ab.c b/drivers/platform/x86/tuxedo/nb04/wmi_ab.c index 32d7756022c2..72205de72256 100644 --- a/drivers/platform/x86/tuxedo/nb04/wmi_ab.c +++ b/drivers/platform/x86/tuxedo/nb04/wmi_ab.c @@ -448,7 +448,7 @@ static int tux_ll_start(struct hid_device *hdev) } driver_data->next_lamp_id = 0; - dev_set_drvdata(&hdev->dev, driver_data); + hdev->driver_data = driver_data; return ret; } @@ -485,7 +485,7 @@ struct __packed lamp_array_attributes_report_t { static int handle_lamp_array_attributes_report(struct hid_device *hdev, struct lamp_array_attributes_report_t *rep) { - struct tux_hdev_driver_data_t *driver_data = dev_get_drvdata(&hdev->dev); + struct tux_hdev_driver_data_t *driver_data = hdev->driver_data; rep->lamp_count = driver_data->lamp_count; rep->bounding_box_width_in_micrometers = 368000; @@ -510,7 +510,7 @@ struct __packed lamp_attributes_request_report_t { static int handle_lamp_attributes_request_report(struct hid_device *hdev, struct lamp_attributes_request_report_t *rep) { - struct tux_hdev_driver_data_t *driver_data = dev_get_drvdata(&hdev->dev); + struct tux_hdev_driver_data_t *driver_data = hdev->driver_data; if (rep->lamp_id < driver_data->lamp_count) driver_data->next_lamp_id = rep->lamp_id; @@ -539,7 +539,7 @@ struct __packed lamp_attributes_response_report_t { static int handle_lamp_attributes_response_report(struct hid_device *hdev, struct lamp_attributes_response_report_t *rep) { - struct tux_hdev_driver_data_t *driver_data = dev_get_drvdata(&hdev->dev); + struct tux_hdev_driver_data_t *driver_data = hdev->driver_data; u16 lamp_id = driver_data->next_lamp_id; rep->lamp_id = lamp_id; @@ -598,7 +598,7 @@ struct __packed lamp_multi_update_report_t { static int handle_lamp_multi_update_report(struct hid_device *hdev, struct lamp_multi_update_report_t *rep) { - struct tux_hdev_driver_data_t *driver_data = dev_get_drvdata(&hdev->dev); + struct tux_hdev_driver_data_t *driver_data = hdev->driver_data; union tux_wmi_xx_496in_80out_in_t *next = &driver_data->next_kbl_set_multiple_keys_in; struct tux_kbl_set_multiple_keys_in_rgb_config_t *rgb_configs_j; struct wmi_device *wdev = to_wmi_device(hdev->dev.parent); @@ -683,7 +683,7 @@ struct __packed lamp_range_update_report_t { static int handle_lamp_range_update_report(struct hid_device *hdev, struct lamp_range_update_report_t *rep) { - struct tux_hdev_driver_data_t *driver_data = dev_get_drvdata(&hdev->dev); + struct tux_hdev_driver_data_t *driver_data = hdev->driver_data; struct lamp_multi_update_report_t lamp_multi_update_report = { .report_id = LAMP_MULTI_UPDATE_REPORT_ID, }; -- 2.43.0