Skip to content

Commit c49965a

Browse files
krzkjic23
authored andcommitted
iio: Move MODULE_DEVICE_TABLE next to the table itself
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>
1 parent a4c18ea commit c49965a

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/iio/chemical/sgp30.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ static const struct of_device_id sgp_dt_ids[] = {
498498
{ .compatible = "sensirion,sgpc3", .data = &sgp_devices[SGPC3] },
499499
{ }
500500
};
501+
MODULE_DEVICE_TABLE(of, sgp_dt_ids);
501502

502503
static int sgp_probe(struct i2c_client *client)
503504
{
@@ -566,9 +567,7 @@ static const struct i2c_device_id sgp_id[] = {
566567
{ "sgpc3", (kernel_ulong_t)&sgp_devices[SGPC3] },
567568
{ }
568569
};
569-
570570
MODULE_DEVICE_TABLE(i2c, sgp_id);
571-
MODULE_DEVICE_TABLE(of, sgp_dt_ids);
572571

573572
static struct i2c_driver sgp_driver = {
574573
.driver = {

drivers/iio/light/cm3232.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ static const struct i2c_device_id cm3232_id[] = {
369369
{ "cm3232" },
370370
{ }
371371
};
372+
MODULE_DEVICE_TABLE(i2c, cm3232_id);
372373

373374
static int cm3232_suspend(struct device *dev)
374375
{
@@ -400,8 +401,6 @@ static int cm3232_resume(struct device *dev)
400401

401402
static DEFINE_SIMPLE_DEV_PM_OPS(cm3232_pm_ops, cm3232_suspend, cm3232_resume);
402403

403-
MODULE_DEVICE_TABLE(i2c, cm3232_id);
404-
405404
static const struct of_device_id cm3232_of_match[] = {
406405
{.compatible = "capella,cm3232"},
407406
{ }

0 commit comments

Comments
 (0)