From: Andy Shevchenko Date: Thu, 24 Oct 2024 19:05:05 +0000 (+0300) Subject: iio: accel: kxcjk-1013: drop ACPI_PTR() and move ID out of CONFIG_ACPI guards X-Git-Tag: v6.13-rc1~28^2~11^2~97 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a84fac0e8547e0f7151af4f21a6340ea975731b7;p=thirdparty%2Flinux.git iio: accel: kxcjk-1013: drop ACPI_PTR() and move ID out of CONFIG_ACPI guards 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 Link: https://patch.msgid.link/20241024191200.229894-17-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 837ed3f41c76b..753ec2f71a9a4 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 #include #include #include #include +#include +#include #include #include #include @@ -471,23 +472,6 @@ static int kiox010a_dsm(struct device *dev, int fn_index) 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, @@ -1740,10 +1724,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), },