[PATCH v3 16/24] iio: accel: kxcjk-1013: drop ACPI_PTR() and move ID out of CONFIG_ACPI guards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 added linux/mod_devicetable.h for
struct acpi_device_id definition.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
 drivers/iio/accel/kxcjk-1013.c | 41 +++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index e8074e0c59a4..baa2674b93f0 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -4,11 +4,12 @@
  * Copyright (c) 2014, Intel Corporation.
  */
 
-#include <linux/module.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/bitops.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/types.h>
@@ -465,24 +466,6 @@ static int kiox010a_dsm(struct device *dev, int fn_index)
 	ACPI_FREE(obj);
 	return 0;
 }
-
-static const struct acpi_device_id kx_acpi_match[] = {
-	{"KIOX0008", (kernel_ulong_t)&kxcj91008_info },
-	{"KIOX0009", (kernel_ulong_t)&kxtj21009_info },
-	{"KIOX000A", (kernel_ulong_t)&kxcj91008_info },
-	/* KXCJ91008 in the display of a yoga 2-in-1 */
-	{"KIOX010A", (kernel_ulong_t)&kxcj91008_kiox010a_info },
-	/* KXCJ91008 in the base of a yoga 2-in-1 */
-	{"KIOX020A", (kernel_ulong_t)&kxcj91008_kiox020a_info },
-	{"KXCJ1008", (kernel_ulong_t)&kxcj91008_info },
-	{"KXCJ1013", (kernel_ulong_t)&kxcjk1013_info },
-	{"KXCJ9000", (kernel_ulong_t)&kxcj91008_info },
-	{"KXJ2109",  (kernel_ulong_t)&kxtj21009_info },
-	{"KXTJ1009", (kernel_ulong_t)&kxtj21009_info },
-	{"SMO8500",  (kernel_ulong_t)&kxcj91008_smo8500_info },
-	{ }
-};
-MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
 #endif
 
 static int kxcjk1013_set_mode(struct kxcjk1013_data *data,
@@ -1736,10 +1719,28 @@ static const struct of_device_id kxcjk1013_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, kxcjk1013_of_match);
 
+static const struct acpi_device_id kx_acpi_match[] = {
+	{"KIOX0008", (kernel_ulong_t)&kxcj91008_info },
+	{"KIOX0009", (kernel_ulong_t)&kxtj21009_info },
+	{"KIOX000A", (kernel_ulong_t)&kxcj91008_info },
+	/* KXCJ91008 in the display of a yoga 2-in-1 */
+	{"KIOX010A", (kernel_ulong_t)&kxcj91008_kiox010a_info },
+	/* KXCJ91008 in the base of a yoga 2-in-1 */
+	{"KIOX020A", (kernel_ulong_t)&kxcj91008_kiox020a_info },
+	{"KXCJ1008", (kernel_ulong_t)&kxcj91008_info },
+	{"KXCJ1013", (kernel_ulong_t)&kxcjk1013_info },
+	{"KXCJ9000", (kernel_ulong_t)&kxcj91008_info },
+	{"KXJ2109",  (kernel_ulong_t)&kxtj21009_info },
+	{"KXTJ1009", (kernel_ulong_t)&kxtj21009_info },
+	{"SMO8500",  (kernel_ulong_t)&kxcj91008_smo8500_info },
+	{ }
+};
+MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
+
 static struct i2c_driver kxcjk1013_driver = {
 	.driver = {
 		.name	= KXCJK1013_DRV_NAME,
-		.acpi_match_table = ACPI_PTR(kx_acpi_match),
+		.acpi_match_table = kx_acpi_match,
 		.of_match_table = kxcjk1013_of_match,
 		.pm	= pm_ptr(&kxcjk1013_pm_ops),
 	},
-- 
2.43.0.rc1.1336.g36b5255a03ac





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux