Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: synaptics_i2c - add OF device ID table

The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Javier Martinez Canillas and committed by
Dmitry Torokhov
72bf60f1 483e55d9

+9
+9
drivers/input/mouse/synaptics_i2c.c
··· 652 652 }; 653 653 MODULE_DEVICE_TABLE(i2c, synaptics_i2c_id_table); 654 654 655 + #ifdef CONFIG_OF 656 + static const struct of_device_id synaptics_i2c_of_match[] = { 657 + { .compatible = "synaptics,synaptics_i2c", }, 658 + { }, 659 + }; 660 + MODULE_DEVICE_TABLE(of, synaptics_i2c_of_match); 661 + #endif 662 + 655 663 static struct i2c_driver synaptics_i2c_driver = { 656 664 .driver = { 657 665 .name = DRIVER_NAME, 666 + .of_match_table = of_match_ptr(synaptics_i2c_of_match), 658 667 .pm = &synaptics_i2c_pm, 659 668 }, 660 669