]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iio: Export I2C module alias information
authorJavier Martinez Canillas <javier@osg.samsung.com>
Tue, 17 May 2016 16:25:37 +0000 (12:25 -0400)
committerJonathan Cameron <jic23@kernel.org>
Sat, 21 May 2016 19:08:14 +0000 (20:08 +0100)
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>
drivers/iio/humidity/am2315.c
drivers/iio/humidity/htu21.c
drivers/iio/pressure/hp206c.c
drivers/iio/pressure/ms5637.c
drivers/iio/temperature/tsys02d.c

index 3be6d209a1595961ddd19dbcf8fc240f07617a77..8de39bd349f9e395cdf11edd4e55212aa32f3d11 100644 (file)
@@ -278,6 +278,7 @@ static const struct i2c_device_id am2315_i2c_id[] = {
        {"am2315", 0},
        {}
 };
+MODULE_DEVICE_TABLE(i2c, am2315_i2c_id);
 
 static const struct acpi_device_id am2315_acpi_id[] = {
        {"AOS2315", 0},
index 11cbc38b450f77179c7713a795a93fcf58f9ac43..0fbbd8c408945358fbdc58510d539ab24717be13 100644 (file)
@@ -236,6 +236,7 @@ static const struct i2c_device_id htu21_id[] = {
        {"ms8607-humidity", MS8607},
        {}
 };
+MODULE_DEVICE_TABLE(i2c, htu21_id);
 
 static struct i2c_driver htu21_driver = {
        .probe = htu21_probe,
index 90f2b6e4a9203670d1d8eec61c77ced37907f18f..12f769e863555c73b7fe8f200e7f8493b09cdfea 100644 (file)
@@ -401,6 +401,7 @@ static const struct i2c_device_id hp206c_id[] = {
        {"hp206c"},
        {}
 };
+MODULE_DEVICE_TABLE(i2c, hp206c_id);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id hp206c_acpi_match[] = {
index e68052c118e60163b023c7e55e0d86dd39793fd8..8fb6f7ab97e4ac206be4eb93592ce17ca16ab69a 100644 (file)
@@ -173,6 +173,7 @@ static const struct i2c_device_id ms5637_id[] = {
        {"ms8607-temppressure", 1},
        {}
 };
+MODULE_DEVICE_TABLE(i2c, ms5637_id);
 
 static struct i2c_driver ms5637_driver = {
        .probe = ms5637_probe,
index ab6fe8f6f2d15da7aab32f379dc00623b6d87fcc..c0a19a00038716258a255223fe5709c993e509dc 100644 (file)
@@ -174,6 +174,7 @@ static const struct i2c_device_id tsys02d_id[] = {
        {"tsys02d", 0},
        {}
 };
+MODULE_DEVICE_TABLE(i2c, tsys02d_id);
 
 static struct i2c_driver tsys02d_driver = {
        .probe = tsys02d_probe,