Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: st_sensors: drop ACPI_PTR() and 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 drop now unneeded linux/acpi.h include.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Denis CIOCCA <denis.ciocca@st.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20231231183514.566609-22-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

+2 -8
+1 -4
drivers/iio/accel/st_accel_i2c.c
··· 10 10 #include <linux/kernel.h> 11 11 #include <linux/module.h> 12 12 #include <linux/mod_devicetable.h> 13 - #include <linux/acpi.h> 14 13 #include <linux/i2c.h> 15 14 #include <linux/iio/iio.h> 16 15 ··· 126 127 }; 127 128 MODULE_DEVICE_TABLE(of, st_accel_of_match); 128 129 129 - #ifdef CONFIG_ACPI 130 130 static const struct acpi_device_id st_accel_acpi_match[] = { 131 131 {"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME}, 132 132 {"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME}, 133 133 { }, 134 134 }; 135 135 MODULE_DEVICE_TABLE(acpi, st_accel_acpi_match); 136 - #endif 137 136 138 137 static const struct i2c_device_id st_accel_id_table[] = { 139 138 { LSM303DLH_ACCEL_DEV_NAME }, ··· 201 204 .driver = { 202 205 .name = "st-accel-i2c", 203 206 .of_match_table = st_accel_of_match, 204 - .acpi_match_table = ACPI_PTR(st_accel_acpi_match), 207 + .acpi_match_table = st_accel_acpi_match, 205 208 }, 206 209 .probe = st_accel_i2c_probe, 207 210 .id_table = st_accel_id_table,
+1 -4
drivers/iio/pressure/st_pressure_i2c.c
··· 7 7 * Denis Ciocca <denis.ciocca@st.com> 8 8 */ 9 9 10 - #include <linux/acpi.h> 11 10 #include <linux/kernel.h> 12 11 #include <linux/module.h> 13 12 #include <linux/mod_devicetable.h> ··· 54 55 }; 55 56 MODULE_DEVICE_TABLE(of, st_press_of_match); 56 57 57 - #ifdef CONFIG_ACPI 58 58 static const struct acpi_device_id st_press_acpi_match[] = { 59 59 {"SNO9210", LPS22HB}, 60 60 { }, 61 61 }; 62 62 MODULE_DEVICE_TABLE(acpi, st_press_acpi_match); 63 - #endif 64 63 65 64 static const struct i2c_device_id st_press_id_table[] = { 66 65 { LPS001WP_PRESS_DEV_NAME, LPS001WP }, ··· 111 114 .driver = { 112 115 .name = "st-press-i2c", 113 116 .of_match_table = st_press_of_match, 114 - .acpi_match_table = ACPI_PTR(st_press_acpi_match), 117 + .acpi_match_table = st_press_acpi_match, 115 118 }, 116 119 .probe = st_press_i2c_probe, 117 120 .id_table = st_press_id_table,