Skip to content

Commit

Permalink
iio: Export I2C module alias information
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Javier Martinez Canillas authored and Jonathan Cameron committed May 21, 2016
1 parent 194dc4c commit cdd469a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iio/humidity/am2315.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/humidity/htu21.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/pressure/hp206c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/pressure/ms5637.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/temperature/tsys02d.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cdd469a

Please sign in to comment.