Commit 042ffa6d authored by Jonathan Cameron's avatar Jonathan Cameron

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: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20231231183514.566609-22-jic23@kernel.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 3c35281c
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
#include <linux/acpi.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
...@@ -127,14 +126,12 @@ static const struct of_device_id st_accel_of_match[] = { ...@@ -127,14 +126,12 @@ static const struct of_device_id st_accel_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, st_accel_of_match); MODULE_DEVICE_TABLE(of, st_accel_of_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id st_accel_acpi_match[] = { static const struct acpi_device_id st_accel_acpi_match[] = {
{"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME}, {"SMO8840", (kernel_ulong_t)LIS2DH12_ACCEL_DEV_NAME},
{"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME}, {"SMO8A90", (kernel_ulong_t)LNG2DM_ACCEL_DEV_NAME},
{ }, { },
}; };
MODULE_DEVICE_TABLE(acpi, st_accel_acpi_match); MODULE_DEVICE_TABLE(acpi, st_accel_acpi_match);
#endif
static const struct i2c_device_id st_accel_id_table[] = { static const struct i2c_device_id st_accel_id_table[] = {
{ LSM303DLH_ACCEL_DEV_NAME }, { LSM303DLH_ACCEL_DEV_NAME },
...@@ -204,7 +201,7 @@ static struct i2c_driver st_accel_driver = { ...@@ -204,7 +201,7 @@ static struct i2c_driver st_accel_driver = {
.driver = { .driver = {
.name = "st-accel-i2c", .name = "st-accel-i2c",
.of_match_table = st_accel_of_match, .of_match_table = st_accel_of_match,
.acpi_match_table = ACPI_PTR(st_accel_acpi_match), .acpi_match_table = st_accel_acpi_match,
}, },
.probe = st_accel_i2c_probe, .probe = st_accel_i2c_probe,
.id_table = st_accel_id_table, .id_table = st_accel_id_table,
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* Denis Ciocca <denis.ciocca@st.com> * Denis Ciocca <denis.ciocca@st.com>
*/ */
#include <linux/acpi.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mod_devicetable.h> #include <linux/mod_devicetable.h>
...@@ -55,13 +54,11 @@ static const struct of_device_id st_press_of_match[] = { ...@@ -55,13 +54,11 @@ static const struct of_device_id st_press_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, st_press_of_match); MODULE_DEVICE_TABLE(of, st_press_of_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id st_press_acpi_match[] = { static const struct acpi_device_id st_press_acpi_match[] = {
{"SNO9210", LPS22HB}, {"SNO9210", LPS22HB},
{ }, { },
}; };
MODULE_DEVICE_TABLE(acpi, st_press_acpi_match); MODULE_DEVICE_TABLE(acpi, st_press_acpi_match);
#endif
static const struct i2c_device_id st_press_id_table[] = { static const struct i2c_device_id st_press_id_table[] = {
{ LPS001WP_PRESS_DEV_NAME, LPS001WP }, { LPS001WP_PRESS_DEV_NAME, LPS001WP },
...@@ -114,7 +111,7 @@ static struct i2c_driver st_press_driver = { ...@@ -114,7 +111,7 @@ static struct i2c_driver st_press_driver = {
.driver = { .driver = {
.name = "st-press-i2c", .name = "st-press-i2c",
.of_match_table = st_press_of_match, .of_match_table = st_press_of_match,
.acpi_match_table = ACPI_PTR(st_press_acpi_match), .acpi_match_table = st_press_acpi_match,
}, },
.probe = st_press_i2c_probe, .probe = st_press_i2c_probe,
.id_table = st_press_id_table, .id_table = st_press_id_table,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment