]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: light: isl29018: drop ACPI_PTR() and CONFIG_ACPI guards
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 24 Oct 2024 19:05:10 +0000 (22:05 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 1 Nov 2024 14:54:44 +0000 (14:54 +0000)
The complexity of config guards needed for ACPI_PTR() is not worthwhile
for the small amount of saved data. This example was doing it correctly
but I am proposing dropping this so as to reduce chance of cut and paste
where it is done wrong.  Also drop now unneeded linux/acpi.h include and
added linux/mod_devicetable.h for struct acpi_device_id definition.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20241024191200.229894-22-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/isl29018.c

index bea3e8826bf30584fc9dc1624f2f5d06b1ba84cb..201eae1c45892b5941265593b0a76caffe8b0c77 100644 (file)
@@ -8,17 +8,18 @@
  * Copyright (c) 2010, NVIDIA Corporation.
  */
 
-#include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/err.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/delay.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
+
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
-#include <linux/acpi.h>
 
 #define ISL29018_CONV_TIME_MS          100
 
@@ -819,15 +820,13 @@ static int isl29018_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(isl29018_pm_ops, isl29018_suspend,
                                isl29018_resume);
 
-#ifdef CONFIG_ACPI
 static const struct acpi_device_id isl29018_acpi_match[] = {
        {"ISL29018", isl29018},
        {"ISL29023", isl29023},
        {"ISL29035", isl29035},
-       {},
+       {}
 };
 MODULE_DEVICE_TABLE(acpi, isl29018_acpi_match);
-#endif
 
 static const struct i2c_device_id isl29018_id[] = {
        {"isl29018", isl29018},
@@ -841,14 +840,14 @@ static const struct of_device_id isl29018_of_match[] = {
        { .compatible = "isil,isl29018", },
        { .compatible = "isil,isl29023", },
        { .compatible = "isil,isl29035", },
-       { },
+       { }
 };
 MODULE_DEVICE_TABLE(of, isl29018_of_match);
 
 static struct i2c_driver isl29018_driver = {
        .driver  = {
                        .name = "isl29018",
-                       .acpi_match_table = ACPI_PTR(isl29018_acpi_match),
+                       .acpi_match_table = isl29018_acpi_match,
                        .pm = pm_sleep_ptr(&isl29018_pm_ops),
                        .of_match_table = isl29018_of_match,
                    },