diff options
Diffstat (limited to 'drivers/input')
29 files changed, 125 insertions, 102 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 01c91fec9b7e..0c22250e192a 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -2396,6 +2396,14 @@ int input_register_device(struct input_dev *dev) } if (dev->devres_managed) { + if (!dev->dev.parent || + !devres_find(dev->dev.parent, devm_input_device_release, + devm_input_device_match, dev)) { + dev_err(&dev->dev, + "Parent of managed input device was overridden, refusing to register\n"); + return -EINVAL; + } + devres = devres_alloc(devm_input_device_unregister, sizeof(*devres), GFP_KERNEL); if (!devres) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index 6293b6e8148b..eb28ff8d7222 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -58,6 +58,8 @@ static void dc_pad_callback(struct mapleq *mq) input_report_abs(dev, ABS_Y, res[13]); input_report_abs(dev, ABS_RX, res[14]); input_report_abs(dev, ABS_RY, res[15]); + + input_sync(dev); } static int dc_pad_open(struct input_dev *dev) @@ -74,8 +76,7 @@ static void dc_pad_close(struct input_dev *dev) { struct dc_pad *pad = dev_get_platdata(&dev->dev); - maple_getcond_callback(pad->mdev, dc_pad_callback, 0, - MAPLE_FUNC_CONTROLLER); + maple_getcond_callback(pad->mdev, NULL, 0, MAPLE_FUNC_CONTROLLER); } /* allow the controller to be used */ @@ -96,7 +97,6 @@ static int probe_maple_controller(struct device *dev) }; struct maple_device *mdev = to_maple_dev(dev); - struct maple_driver *mdrv = to_maple_driver(dev->driver); int i, error; struct dc_pad *pad; struct input_dev *idev; @@ -118,26 +118,19 @@ static int probe_maple_controller(struct device *dev) idev->close = dc_pad_close; for (i = 0; i < 32; i++) { - if (data & (1 << i)) { + if (data & BIT(i)) { if (btn_bit[i] >= 0) __set_bit(btn_bit[i], idev->keybit); - else if (abs_bit[i] >= 0) - __set_bit(abs_bit[i], idev->absbit); + else if (abs_bit[i] >= ABS_X && abs_bit[i] <= ABS_BRAKE) + input_set_abs_params(idev, abs_bit[i], 0, 255, 0, 0); + else if (abs_bit[i] >= ABS_HAT0X && abs_bit[i] <= ABS_HAT3Y) + input_set_abs_params(idev, abs_bit[i], -1, 1, 0, 0); } } if (idev->keybit[BIT_WORD(BTN_JOYSTICK)]) idev->evbit[0] |= BIT_MASK(EV_KEY); - if (idev->absbit[0]) - idev->evbit[0] |= BIT_MASK(EV_ABS); - - for (i = ABS_X; i <= ABS_BRAKE; i++) - input_set_abs_params(idev, i, 0, 255, 0, 0); - - for (i = ABS_HAT0X; i <= ABS_HAT3Y; i++) - input_set_abs_params(idev, i, 1, -1, 0, 0); - idev->dev.platform_data = pad; idev->dev.parent = &mdev->dev; idev->name = mdev->product_name; @@ -146,15 +139,11 @@ static int probe_maple_controller(struct device *dev) error = input_register_device(idev); if (error) goto fail; - - mdev->driver = mdrv; - return 0; fail: input_free_device(idev); kfree(pad); - maple_set_drvdata(mdev, NULL); return error; } @@ -163,9 +152,7 @@ static int remove_maple_controller(struct device *dev) struct maple_device *mdev = to_maple_dev(dev); struct dc_pad *pad = maple_get_drvdata(mdev); - mdev->callback = NULL; input_unregister_device(pad->dev); - maple_set_drvdata(mdev, NULL); kfree(pad); return 0; diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c index da8fa3938a36..7d5ed45845bc 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -1902,7 +1902,7 @@ static int applespi_resume(struct device *dev) } static const struct acpi_device_id applespi_acpi_match[] = { - { "APP000D", 0 }, + { .id = "APP000D" }, { } }; MODULE_DEVICE_TABLE(acpi, applespi_acpi_match); diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index e1df5f466c9d..0a817680171c 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -909,7 +909,7 @@ static void cros_ec_keyb_remove(struct platform_device *pdev) #ifdef CONFIG_ACPI static const struct acpi_device_id cros_ec_keyb_acpi_match[] = { - { "GOOG0007", true }, + { .id = "GOOG0007", .driver_data = true }, { } }; MODULE_DEVICE_TABLE(acpi, cros_ec_keyb_acpi_match); diff --git a/drivers/input/keyboard/goldfish_events.c b/drivers/input/keyboard/goldfish_events.c index 57d435fc5c73..d0e387f22faf 100644 --- a/drivers/input/keyboard/goldfish_events.c +++ b/drivers/input/keyboard/goldfish_events.c @@ -179,8 +179,8 @@ MODULE_DEVICE_TABLE(of, goldfish_events_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id goldfish_events_acpi_match[] = { - { "GFSH0002", 0 }, - { }, + { .id = "GFSH0002" }, + { } }; MODULE_DEVICE_TABLE(acpi, goldfish_events_acpi_match); #endif diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 3d5538dd4f23..e277b929a375 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -107,7 +107,7 @@ static void dc_scan_kbd(struct dc_kbd *kbd) } ptr = memchr(kbd->old + 2, kbd->new[i], 6); code = kbd->new[i]; - if (code > 3 && ptr) { + if (code > 3 && !ptr) { keycode = kbd->keycode[code]; if (keycode) { input_event(dev, EV_MSC, MSC_SCAN, code); @@ -140,16 +140,32 @@ static void dc_kbd_callback(struct mapleq *mq) } } +static int dc_kbd_open(struct input_dev *dev) +{ + struct maple_device *mdev = input_get_drvdata(dev); + + /* Maple polling is locked to VBLANK - which may be just 50/s */ + maple_getcond_callback(mdev, dc_kbd_callback, HZ / 50, + MAPLE_FUNC_KEYBOARD); + + return 0; +} + +static void dc_kbd_close(struct input_dev *dev) +{ + struct maple_device *mdev = input_get_drvdata(dev); + + maple_getcond_callback(mdev, NULL, 0, MAPLE_FUNC_KEYBOARD); +} + static int probe_maple_kbd(struct device *dev) { struct maple_device *mdev; - struct maple_driver *mdrv; int i, error; struct dc_kbd *kbd; struct input_dev *idev; mdev = to_maple_dev(dev); - mdrv = to_maple_driver(dev->driver); kbd = kzalloc_obj(*kbd); if (!kbd) { @@ -167,6 +183,7 @@ static int probe_maple_kbd(struct device *dev) memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode)); maple_set_drvdata(mdev, kbd); + input_set_drvdata(idev, mdev); idev->name = mdev->product_name; idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); @@ -175,6 +192,8 @@ static int probe_maple_kbd(struct device *dev) idev->keycodemax = ARRAY_SIZE(kbd->keycode); idev->id.bustype = BUS_HOST; idev->dev.parent = &mdev->dev; + idev->open = dc_kbd_open; + idev->close = dc_kbd_close; for (i = 0; i < NR_SCANCODES; i++) __set_bit(dc_kbd_keycode[i], idev->keybit); @@ -185,17 +204,9 @@ static int probe_maple_kbd(struct device *dev) error = input_register_device(idev); if (error) goto fail_register; - - /* Maple polling is locked to VBLANK - which may be just 50/s */ - maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, - MAPLE_FUNC_KEYBOARD); - - mdev->driver = mdrv; - return error; fail_register: - maple_set_drvdata(mdev, NULL); input_free_device(idev); fail_idev_alloc: kfree(kbd); @@ -213,7 +224,6 @@ static int remove_maple_kbd(struct device *dev) input_unregister_device(kbd->dev); kfree(kbd); - maple_set_drvdata(mdev, NULL); return 0; } diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index ca177a708e55..2fbdf373fe99 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c @@ -75,6 +75,8 @@ static int keyscan_start(struct st_keyscan *keypad) writel(KEYSCAN_CONFIG_ENABLE, keypad->base + KEYSCAN_CONFIG_OFF); + enable_irq(keypad->irq); + return 0; } @@ -82,6 +84,8 @@ static void keyscan_stop(struct st_keyscan *keypad) { writel(0, keypad->base + KEYSCAN_CONFIG_OFF); + disable_irq(keypad->irq); + clk_disable(keypad->clk); } @@ -176,20 +180,12 @@ static int keyscan_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, PTR_ERR(keypad_data->clk), "cannot get clock\n"); - error = clk_enable(keypad_data->clk); - if (error) { - dev_err(&pdev->dev, "failed to enable clock\n"); - return error; - } - - keyscan_stop(keypad_data); - keypad_data->irq = platform_get_irq(pdev, 0); if (keypad_data->irq < 0) return keypad_data->irq; - error = devm_request_irq(&pdev->dev, keypad_data->irq, keyscan_isr, 0, - pdev->name, keypad_data); + error = devm_request_irq(&pdev->dev, keypad_data->irq, keyscan_isr, + IRQF_NO_AUTOEN, pdev->name, keypad_data); if (error) return error; diff --git a/drivers/input/misc/atlas_btns.c b/drivers/input/misc/atlas_btns.c index 5805a1a3bb05..e77e53ee9d41 100644 --- a/drivers/input/misc/atlas_btns.c +++ b/drivers/input/misc/atlas_btns.c @@ -128,8 +128,8 @@ static void atlas_acpi_button_remove(struct platform_device *pdev) } static const struct acpi_device_id atlas_device_ids[] = { - { "ASIM0000" }, - { "" } + { .id = "ASIM0000" }, + { } }; MODULE_DEVICE_TABLE(acpi, atlas_device_ids); diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c index 77fcf868dca2..e607836efb50 100644 --- a/drivers/input/misc/da7280.c +++ b/drivers/input/misc/da7280.c @@ -1218,7 +1218,6 @@ static int da7280_probe(struct i2c_client *client) } input_dev->name = "da7280-haptic"; - input_dev->dev.parent = client->dev.parent; input_dev->open = da7280_haptic_open; input_dev->close = da7280_haptic_close; input_set_drvdata(input_dev, haptics); diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c index 6c5c4c53753b..8a3d74d65d63 100644 --- a/drivers/input/misc/drv260x.c +++ b/drivers/input/misc/drv260x.c @@ -640,7 +640,7 @@ MODULE_DEVICE_TABLE(i2c, drv260x_id); #ifdef CONFIG_ACPI static const struct acpi_device_id drv260x_acpi_match[] = { - { "DRV2604" }, + { .id = "DRV2604" }, { } }; MODULE_DEVICE_TABLE(acpi, drv260x_acpi_match); diff --git a/drivers/input/misc/drv2665.c b/drivers/input/misc/drv2665.c index 4f8c1f69aa63..134d65fdcf2d 100644 --- a/drivers/input/misc/drv2665.c +++ b/drivers/input/misc/drv2665.c @@ -180,7 +180,6 @@ static int drv2665_probe(struct i2c_client *client) } haptics->input_dev->name = "drv2665:haptics"; - haptics->input_dev->dev.parent = client->dev.parent; haptics->input_dev->close = drv2665_close; input_set_drvdata(haptics->input_dev, haptics); input_set_capability(haptics->input_dev, EV_FF, FF_RUMBLE); diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c index 97309984fa7c..bbda7b4cbdcb 100644 --- a/drivers/input/misc/drv2667.c +++ b/drivers/input/misc/drv2667.c @@ -357,7 +357,6 @@ static int drv2667_probe(struct i2c_client *client) } haptics->input_dev->name = "drv2667:haptics"; - haptics->input_dev->dev.parent = client->dev.parent; haptics->input_dev->close = drv2667_close; input_set_drvdata(haptics->input_dev, haptics); input_set_capability(haptics->input_dev, EV_FF, FF_RUMBLE); diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index 064243677fcf..dbf86ea778e6 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -603,14 +603,14 @@ static const struct soc_device_data soc_device_MSHW0040 = { }; static const struct acpi_device_id soc_button_acpi_match[] = { - { "PNP0C40", (unsigned long)&soc_device_PNP0C40 }, - { "INT33D3", (unsigned long)&soc_device_INT33D3 }, - { "ID9001", (unsigned long)&soc_device_INT33D3 }, - { "ACPI0011", 0 }, + { .id = "PNP0C40", .driver_data = (unsigned long)&soc_device_PNP0C40 }, + { .id = "INT33D3", .driver_data = (unsigned long)&soc_device_INT33D3 }, + { .id = "ID9001", .driver_data = (unsigned long)&soc_device_INT33D3 }, + { .id = "ACPI0011" }, /* Microsoft Surface Devices (3th, 5th and 6th generation) */ - { "MSHW0028", (unsigned long)&soc_device_MSHW0028 }, - { "MSHW0040", (unsigned long)&soc_device_MSHW0040 }, + { .id = "MSHW0028", .driver_data = (unsigned long)&soc_device_MSHW0028 }, + { .id = "MSHW0040", .driver_data = (unsigned long)&soc_device_MSHW0040 }, { } }; diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c index 5d99abea89aa..a8e9b9ab9f84 100644 --- a/drivers/input/mouse/cyapa.c +++ b/drivers/input/mouse/cyapa.c @@ -1462,9 +1462,9 @@ MODULE_DEVICE_TABLE(i2c, cyapa_id_table); #ifdef CONFIG_ACPI static const struct acpi_device_id cyapa_acpi_id[] = { - { "CYAP0000", 0 }, /* Gen3 trackpad with 0x67 I2C address. */ - { "CYAP0001", 0 }, /* Gen5 trackpad with 0x24 I2C address. */ - { "CYAP0002", 0 }, /* Gen6 trackpad with 0x24 I2C address. */ + { .id = "CYAP0000" }, /* Gen3 trackpad with 0x67 I2C address. */ + { .id = "CYAP0001" }, /* Gen5 trackpad with 0x24 I2C address. */ + { .id = "CYAP0002" }, /* Gen6 trackpad with 0x24 I2C address. */ { } }; MODULE_DEVICE_TABLE(acpi, cyapa_acpi_id); diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index 0c8f7d1b02aa..f67e3eb5841b 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -60,15 +60,13 @@ static void dc_mouse_close(struct input_dev *dev) { struct dc_mouse *mse = input_get_drvdata(dev); - maple_getcond_callback(mse->mdev, dc_mouse_callback, 0, - MAPLE_FUNC_MOUSE); + maple_getcond_callback(mse->mdev, NULL, 0, MAPLE_FUNC_MOUSE); } /* allow the mouse to be used */ static int probe_maple_mouse(struct device *dev) { struct maple_device *mdev = to_maple_dev(dev); - struct maple_driver *mdrv = to_maple_driver(dev->driver); int error; struct input_dev *input_dev; struct dc_mouse *mse; @@ -103,14 +101,10 @@ static int probe_maple_mouse(struct device *dev) error = input_register_device(input_dev); if (error) goto fail_register; - - mdev->driver = mdrv; - return error; fail_register: input_free_device(input_dev); - maple_set_drvdata(mdev, NULL); fail_nomem: kfree(mse); fail: @@ -122,9 +116,7 @@ static int remove_maple_mouse(struct device *dev) struct maple_device *mdev = to_maple_dev(dev); struct dc_mouse *mse = maple_get_drvdata(mdev); - mdev->callback = NULL; input_unregister_device(mse->dev); - maple_set_drvdata(mdev, NULL); kfree(mse); return 0; diff --git a/drivers/input/tests/input_test.c b/drivers/input/tests/input_test.c index e105ce71a920..b8c8f04c041b 100644 --- a/drivers/input/tests/input_test.c +++ b/drivers/input/tests/input_test.c @@ -8,6 +8,7 @@ #include <linux/delay.h> #include <linux/input.h> +#include <kunit/device.h> #include <kunit/test.h> #define POLL_INTERVAL 100 @@ -161,11 +162,44 @@ static void input_test_grab(struct kunit *test) input_put_device(input_dev); } +static void input_test_managed_parent_override(struct kunit *test) +{ + struct device *owner, *other_dev; + struct input_dev *input_dev; + + owner = kunit_device_register(test, "input-test-owner"); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, owner); + + other_dev = kunit_device_register(test, "input-test-other"); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, other_dev); + + /* Overriding dev.parent to another device must be rejected */ + input_dev = devm_input_allocate_device(owner); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, input_dev); + input_dev->name = "Managed input device (reparented)"; + input_dev->dev.parent = other_dev; + KUNIT_EXPECT_EQ(test, input_register_device(input_dev), -EINVAL); + + /* Clearing dev.parent to NULL must be rejected */ + input_dev = devm_input_allocate_device(owner); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, input_dev); + input_dev->name = "Managed input device (null parent)"; + input_dev->dev.parent = NULL; + KUNIT_EXPECT_EQ(test, input_register_device(input_dev), -EINVAL); + + /* Preserving original owner as dev.parent succeeds */ + input_dev = devm_input_allocate_device(owner); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, input_dev); + input_dev->name = "Managed input device (valid parent)"; + KUNIT_EXPECT_EQ(test, input_register_device(input_dev), 0); +} + static struct kunit_case input_tests[] = { KUNIT_CASE(input_test_polling), KUNIT_CASE(input_test_timestamp), KUNIT_CASE(input_test_match_device_id), KUNIT_CASE(input_test_grab), + KUNIT_CASE(input_test_managed_parent_override), { /* sentinel */ } }; diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 2c0e5a67135b..522e1ea405a6 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3409,8 +3409,8 @@ MODULE_DEVICE_TABLE(of, mxt_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id mxt_acpi_id[] = { - { "ATML0000", 0 }, /* Touchpad */ - { "ATML0001", 0 }, /* Touchscreen */ + { .id = "ATML0000" }, /* Touchpad */ + { .id = "ATML0001" }, /* Touchscreen */ { } }; MODULE_DEVICE_TABLE(acpi, mxt_acpi_id); diff --git a/drivers/input/touchscreen/chipone_icn8505.c b/drivers/input/touchscreen/chipone_icn8505.c index cde0e4789503..7d0a488166bb 100644 --- a/drivers/input/touchscreen/chipone_icn8505.c +++ b/drivers/input/touchscreen/chipone_icn8505.c @@ -486,7 +486,7 @@ static int icn8505_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume); static const struct acpi_device_id icn8505_acpi_match[] = { - { "CHPN0001" }, + { .id = "CHPN0001" }, { } }; MODULE_DEVICE_TABLE(acpi, icn8505_acpi_match); diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index 17175adcaebb..7a651899feb1 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -1360,9 +1360,9 @@ static void elants_i2c_power_off(void *_data) #ifdef CONFIG_ACPI static const struct acpi_device_id i2c_hid_ids[] = { - {"ACPI0C50", 0 }, - {"PNP0C50", 0 }, - { }, + { .id = "ACPI0C50" }, + { .id = "PNP0C50" }, + { } }; static const guid_t i2c_hid_guid = @@ -1624,7 +1624,7 @@ MODULE_DEVICE_TABLE(i2c, elants_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id elants_acpi_id[] = { - { "ELAN0001", EKTH3500 }, + { .id = "ELAN0001", .driver_data = EKTH3500 }, { } }; MODULE_DEVICE_TABLE(acpi, elants_acpi_id); diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c index 037bb35238a3..d1f9b44d9d76 100644 --- a/drivers/input/touchscreen/exc3000.c +++ b/drivers/input/touchscreen/exc3000.c @@ -453,7 +453,7 @@ MODULE_DEVICE_TABLE(of, exc3000_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id exc3000_acpi_match[] = { - { "EGA00001", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] }, + { .id = "EGA00001", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] }, { } }; MODULE_DEVICE_TABLE(acpi, exc3000_acpi_match); diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 03efc0c792c2..7609366f0b78 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -1531,10 +1531,10 @@ MODULE_DEVICE_TABLE(i2c, goodix_ts_id); #ifdef CONFIG_ACPI static const struct acpi_device_id goodix_acpi_match[] = { - { "GDIX1001", 0 }, - { "GDIX1002", 0 }, - { "GDIX1003", 0 }, - { "GDX9110", 0 }, + { .id = "GDIX1001" }, + { .id = "GDIX1002" }, + { .id = "GDIX1003" }, + { .id = "GDX9110" }, { } }; MODULE_DEVICE_TABLE(acpi, goodix_acpi_match); diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c index 58e00c314ace..68ee61c71df6 100644 --- a/drivers/input/touchscreen/hideep.c +++ b/drivers/input/touchscreen/hideep.c @@ -1088,7 +1088,7 @@ MODULE_DEVICE_TABLE(i2c, hideep_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id hideep_acpi_id[] = { - { "HIDP0001", 0 }, + { .id = "HIDP0001" }, { } }; MODULE_DEVICE_TABLE(acpi, hideep_acpi_id); diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c index 3de0fbf8da38..cdd02b7b6f67 100644 --- a/drivers/input/touchscreen/ilitek_ts_i2c.c +++ b/drivers/input/touchscreen/ilitek_ts_i2c.c @@ -646,8 +646,8 @@ MODULE_DEVICE_TABLE(i2c, ilitek_ts_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id ilitekts_acpi_id[] = { - { "ILTK0001", 0 }, - { }, + { .id = "ILTK0001" }, + { } }; MODULE_DEVICE_TABLE(acpi, ilitekts_acpi_id); #endif diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index fd6c0ac301a2..0c8a922e2f2e 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -1529,8 +1529,8 @@ MODULE_DEVICE_TABLE(of, mip4_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id mip4_acpi_match[] = { - { "MLFS0000", 0}, - { }, + { .id = "MLFS0000" }, + { } }; MODULE_DEVICE_TABLE(acpi, mip4_acpi_match); #endif diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index 0256055abcef..d046eba4b12d 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c @@ -1227,8 +1227,8 @@ MODULE_DEVICE_TABLE(i2c, raydium_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id raydium_acpi_id[] = { - { "RAYD0001", 0 }, - { /* sentinel */ } + { .id = "RAYD0001" }, + { } }; MODULE_DEVICE_TABLE(acpi, raydium_acpi_id); #endif diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index 44d7141103f4..6014c4e049a6 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c @@ -788,15 +788,15 @@ MODULE_DEVICE_TABLE(i2c, silead_ts_id); #ifdef CONFIG_ACPI static const struct acpi_device_id silead_ts_acpi_match[] = { - { "GSL1680", 0 }, - { "GSL1688", 0 }, - { "GSL3670", 0 }, - { "GSL3675", 0 }, - { "GSL3692", 0 }, - { "MSSL1680", 0 }, - { "MSSL0001", 0 }, - { "MSSL0002", 0 }, - { "MSSL0017", 0 }, + { .id = "GSL1680" }, + { .id = "GSL1688" }, + { .id = "GSL3670" }, + { .id = "GSL3675" }, + { .id = "GSL3692" }, + { .id = "MSSL1680" }, + { .id = "MSSL0001" }, + { .id = "MSSL0002" }, + { .id = "MSSL0017" }, { } }; MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match); diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c index 6074b7730e86..9d74efc8d986 100644 --- a/drivers/input/touchscreen/surface3_spi.c +++ b/drivers/input/touchscreen/surface3_spi.c @@ -392,7 +392,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops, #ifdef CONFIG_ACPI static const struct acpi_device_id surface3_spi_acpi_match[] = { - { "MSHW0037", 0 }, + { .id = "MSHW0037" }, { } }; MODULE_DEVICE_TABLE(acpi, surface3_spi_acpi_match); diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index f48871767763..e84dc3ea1fcb 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c @@ -251,7 +251,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev) input_dev->name = "TPS6507x Touchscreen"; input_dev->phys = tsc->phys; - input_dev->dev.parent = tsc->dev; input_dev->id.bustype = BUS_I2C; if (init_data) { input_dev->id.vendor = init_data->vendor; diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c index 1af309252092..858c7efd0c29 100644 --- a/drivers/input/touchscreen/wdt87xx_i2c.c +++ b/drivers/input/touchscreen/wdt87xx_i2c.c @@ -1147,7 +1147,7 @@ MODULE_DEVICE_TABLE(i2c, wdt87xx_dev_id); #ifdef CONFIG_ACPI static const struct acpi_device_id wdt87xx_acpi_id[] = { - { "WDHT0001", 0 }, + { .id = "WDHT0001" }, { } }; MODULE_DEVICE_TABLE(acpi, wdt87xx_acpi_id); |
