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

hwmon: (adc128d818) 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: Guenter Roeck <linux@roeck-us.net>

authored by

Javier Martinez Canillas and committed by
Guenter Roeck
d593e665 72edf311

+7
+7
drivers/hwmon/adc128d818.c
··· 546 546 }; 547 547 MODULE_DEVICE_TABLE(i2c, adc128_id); 548 548 549 + static const struct of_device_id adc128_of_match[] = { 550 + { .compatible = "ti,adc128d818" }, 551 + { }, 552 + }; 553 + MODULE_DEVICE_TABLE(of, adc128_of_match); 554 + 549 555 static struct i2c_driver adc128_driver = { 550 556 .class = I2C_CLASS_HWMON, 551 557 .driver = { 552 558 .name = "adc128d818", 559 + .of_match_table = of_match_ptr(adc128_of_match), 553 560 }, 554 561 .probe = adc128_probe, 555 562 .remove = adc128_remove,