Skip to content

Commit

Permalink
HID: multitouch: make sure the static list of class is not changed
Browse files Browse the repository at this point in the history
const is a magic keyword here :)

Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Jul 17, 2018
1 parent b875a5a commit cf6d15d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static int cypress_compute_slot(struct mt_device *td)
return -1;
}

static struct mt_class mt_classes[] = {
static const struct mt_class mt_classes[] = {
{ .name = MT_CLS_DEFAULT,
.quirks = MT_QUIRK_ALWAYS_VALID |
MT_QUIRK_CONTACT_CNT_ACCURATE },
Expand Down Expand Up @@ -1432,7 +1432,7 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
int ret, i;
struct mt_device *td;
struct mt_class *mtclass = mt_classes; /* MT_CLS_DEFAULT */
const struct mt_class *mtclass = mt_classes; /* MT_CLS_DEFAULT */

for (i = 0; mt_classes[i].name ; i++) {
if (id->driver_data == mt_classes[i].name) {
Expand Down

0 comments on commit cf6d15d

Please sign in to comment.