]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: Move MODULE_DEVICE_TABLE next to the table itself
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Tue, 5 May 2026 10:29:04 +0000 (12:29 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:34 +0000 (10:59 +0100)
By convention MODULE_DEVICE_TABLE() immediately follows the ID table it
exports, because this is easier to read and verify.  It also makes more
sense since #ifdef for ACPI or OF could hide both of them.

Most of the drivers already have this correctly placed, so adjust
the missing ones.  No functional impact.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/chemical/sgp30.c
drivers/iio/light/cm3232.c

index 21730d62b5c8dfc1796fcb474bd1734553d423f7..d42b62b7081e97982ef13bc94559f551f19e091c 100644 (file)
@@ -498,6 +498,7 @@ static const struct of_device_id sgp_dt_ids[] = {
        { .compatible = "sensirion,sgpc3", .data = &sgp_devices[SGPC3] },
        { }
 };
+MODULE_DEVICE_TABLE(of, sgp_dt_ids);
 
 static int sgp_probe(struct i2c_client *client)
 {
@@ -566,9 +567,7 @@ static const struct i2c_device_id sgp_id[] = {
        { "sgpc3", (kernel_ulong_t)&sgp_devices[SGPC3] },
        { }
 };
-
 MODULE_DEVICE_TABLE(i2c, sgp_id);
-MODULE_DEVICE_TABLE(of, sgp_dt_ids);
 
 static struct i2c_driver sgp_driver = {
        .driver = {
index 3a3ad6b4c46860cb401e8084c47d3abe1f3f4169..90aa77e3a03b5cf8a0870b58463c2ff466d18342 100644 (file)
@@ -369,6 +369,7 @@ static const struct i2c_device_id cm3232_id[] = {
        { "cm3232" },
        { }
 };
+MODULE_DEVICE_TABLE(i2c, cm3232_id);
 
 static int cm3232_suspend(struct device *dev)
 {
@@ -400,8 +401,6 @@ static int cm3232_resume(struct device *dev)
 
 static DEFINE_SIMPLE_DEV_PM_OPS(cm3232_pm_ops, cm3232_suspend, cm3232_resume);
 
-MODULE_DEVICE_TABLE(i2c, cm3232_id);
-
 static const struct of_device_id cm3232_of_match[] = {
        {.compatible = "capella,cm3232"},
        { }