Skip to content

Commit 52d2253

Browse files
t-8chJiri Kosina
authored andcommitted
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 <[email protected]> Reviewed-by: David Rheinsberg <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent ebb45d6 commit 52d2253

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

drivers/hid/i2c-hid/i2c-hid-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ static void i2c_hid_close(struct hid_device *hid)
842842
clear_bit(I2C_HID_STARTED, &ihid->flags);
843843
}
844844

845-
static struct hid_ll_driver i2c_hid_ll_driver = {
845+
static const struct hid_ll_driver i2c_hid_ll_driver = {
846846
.parse = i2c_hid_parse,
847847
.start = i2c_hid_start,
848848
.stop = i2c_hid_stop,

drivers/hid/uhid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf,
387387
return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT);
388388
}
389389

390-
static struct hid_ll_driver uhid_hid_driver = {
390+
static const struct hid_ll_driver uhid_hid_driver = {
391391
.start = uhid_hid_start,
392392
.stop = uhid_hid_stop,
393393
.open = uhid_hid_open,

drivers/hid/usbhid/hid-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ static bool usbhid_may_wakeup(struct hid_device *hid)
13181318
return device_may_wakeup(&dev->dev);
13191319
}
13201320

1321-
static struct hid_ll_driver usb_hid_driver = {
1321+
static const struct hid_ll_driver usb_hid_driver = {
13221322
.parse = usbhid_parse,
13231323
.start = usbhid_start,
13241324
.stop = usbhid_stop,

include/linux/hid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ struct hid_device { /* device report descriptor */
596596
struct device dev; /* device */
597597
struct hid_driver *driver;
598598

599-
struct hid_ll_driver *ll_driver;
599+
const struct hid_ll_driver *ll_driver;
600600
struct mutex ll_open_lock;
601601
unsigned int ll_open_count;
602602

net/bluetooth/hidp/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ static void hidp_stop(struct hid_device *hid)
739739
hid->claimed = 0;
740740
}
741741

742-
static struct hid_ll_driver hidp_hid_driver = {
742+
static const struct hid_ll_driver hidp_hid_driver = {
743743
.parse = hidp_parse,
744744
.start = hidp_start,
745745
.stop = hidp_stop,

0 commit comments

Comments
 (0)