HID: Make lowlevel driver structs const

Nothing is nor should be modifying these structs so mark them as const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: David Rheinsberg <david.rheinsberg@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Thomas Weißschuh 2022-12-22 05:10:51 +00:00 коммит произвёл Jiri Kosina
Родитель ebb45d6bee
Коммит 52d2253469
5 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -842,7 +842,7 @@ static void i2c_hid_close(struct hid_device *hid)
clear_bit(I2C_HID_STARTED, &ihid->flags); clear_bit(I2C_HID_STARTED, &ihid->flags);
} }
static struct hid_ll_driver i2c_hid_ll_driver = { static const struct hid_ll_driver i2c_hid_ll_driver = {
.parse = i2c_hid_parse, .parse = i2c_hid_parse,
.start = i2c_hid_start, .start = i2c_hid_start,
.stop = i2c_hid_stop, .stop = i2c_hid_stop,

Просмотреть файл

@ -387,7 +387,7 @@ static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf,
return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT); return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT);
} }
static struct hid_ll_driver uhid_hid_driver = { static const struct hid_ll_driver uhid_hid_driver = {
.start = uhid_hid_start, .start = uhid_hid_start,
.stop = uhid_hid_stop, .stop = uhid_hid_stop,
.open = uhid_hid_open, .open = uhid_hid_open,

Просмотреть файл

@ -1318,7 +1318,7 @@ static bool usbhid_may_wakeup(struct hid_device *hid)
return device_may_wakeup(&dev->dev); return device_may_wakeup(&dev->dev);
} }
static struct hid_ll_driver usb_hid_driver = { static const struct hid_ll_driver usb_hid_driver = {
.parse = usbhid_parse, .parse = usbhid_parse,
.start = usbhid_start, .start = usbhid_start,
.stop = usbhid_stop, .stop = usbhid_stop,

Просмотреть файл

@ -596,7 +596,7 @@ struct hid_device { /* device report descriptor */
struct device dev; /* device */ struct device dev; /* device */
struct hid_driver *driver; struct hid_driver *driver;
struct hid_ll_driver *ll_driver; const struct hid_ll_driver *ll_driver;
struct mutex ll_open_lock; struct mutex ll_open_lock;
unsigned int ll_open_count; unsigned int ll_open_count;

Просмотреть файл

@ -739,7 +739,7 @@ static void hidp_stop(struct hid_device *hid)
hid->claimed = 0; hid->claimed = 0;
} }
static struct hid_ll_driver hidp_hid_driver = { static const struct hid_ll_driver hidp_hid_driver = {
.parse = hidp_parse, .parse = hidp_parse,
.start = hidp_start, .start = hidp_start,
.stop = hidp_stop, .stop = hidp_stop,