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

iio: Export I2C module alias information

The I2C drivers have an i2c_device_id array but that information isn't
exported to the modules using the MODULE_DEVICE_TABLE() macro. So the
modules autoloading won't work if the I2C device is registered using
OF or legacy board files due missing alias information in the modules.

The issue was found using Kieran Bingham's coccinelle semantic patch:
https://lkml.org/lkml/2016/5/10/520

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Javier Martinez Canillas and committed by
Jonathan Cameron
cdd469ad 194dc4c7

+5
+1
drivers/iio/humidity/am2315.c
··· 278 278 {"am2315", 0}, 279 279 {} 280 280 }; 281 + MODULE_DEVICE_TABLE(i2c, am2315_i2c_id); 281 282 282 283 static const struct acpi_device_id am2315_acpi_id[] = { 283 284 {"AOS2315", 0},
+1
drivers/iio/humidity/htu21.c
··· 236 236 {"ms8607-humidity", MS8607}, 237 237 {} 238 238 }; 239 + MODULE_DEVICE_TABLE(i2c, htu21_id); 239 240 240 241 static struct i2c_driver htu21_driver = { 241 242 .probe = htu21_probe,
+1
drivers/iio/pressure/hp206c.c
··· 401 401 {"hp206c"}, 402 402 {} 403 403 }; 404 + MODULE_DEVICE_TABLE(i2c, hp206c_id); 404 405 405 406 #ifdef CONFIG_ACPI 406 407 static const struct acpi_device_id hp206c_acpi_match[] = {
+1
drivers/iio/pressure/ms5637.c
··· 173 173 {"ms8607-temppressure", 1}, 174 174 {} 175 175 }; 176 + MODULE_DEVICE_TABLE(i2c, ms5637_id); 176 177 177 178 static struct i2c_driver ms5637_driver = { 178 179 .probe = ms5637_probe,
+1
drivers/iio/temperature/tsys02d.c
··· 174 174 {"tsys02d", 0}, 175 175 {} 176 176 }; 177 + MODULE_DEVICE_TABLE(i2c, tsys02d_id); 177 178 178 179 static struct i2c_driver tsys02d_driver = { 179 180 .probe = tsys02d_probe,