Commit c53c7740 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: imu: inv_mpu6050: Drop wrong use of ACPI_PTR()

ACPI_PTR() is more harmful than helpful. For example, in this case
if CONFIG_ACPI=n, the ID table left unused which is not what we want.

Instead of adding ifdeffery or attribute here and there, drop ACPI_PTR().
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220203155920.18586-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 08f5fbf0
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
* Copyright (C) 2012 Invensense, Inc. * Copyright (C) 2012 Invensense, Inc.
*/ */
#include <linux/acpi.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/property.h> #include <linux/property.h>
...@@ -249,11 +249,10 @@ static const struct of_device_id inv_of_match[] = { ...@@ -249,11 +249,10 @@ static const struct of_device_id inv_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, inv_of_match); MODULE_DEVICE_TABLE(of, inv_of_match);
static const struct acpi_device_id __maybe_unused inv_acpi_match[] = { static const struct acpi_device_id inv_acpi_match[] = {
{"INVN6500", INV_MPU6500}, {"INVN6500", INV_MPU6500},
{ }, { },
}; };
MODULE_DEVICE_TABLE(acpi, inv_acpi_match); MODULE_DEVICE_TABLE(acpi, inv_acpi_match);
static struct i2c_driver inv_mpu_driver = { static struct i2c_driver inv_mpu_driver = {
...@@ -262,7 +261,7 @@ static struct i2c_driver inv_mpu_driver = { ...@@ -262,7 +261,7 @@ static struct i2c_driver inv_mpu_driver = {
.id_table = inv_mpu_id, .id_table = inv_mpu_id,
.driver = { .driver = {
.of_match_table = inv_of_match, .of_match_table = inv_of_match,
.acpi_match_table = ACPI_PTR(inv_acpi_match), .acpi_match_table = inv_acpi_match,
.name = "inv-mpu6050-i2c", .name = "inv-mpu6050-i2c",
.pm = &inv_mpu_pmops, .pm = &inv_mpu_pmops,
}, },
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
/* /*
* Copyright (C) 2015 Intel Corporation Inc. * Copyright (C) 2015 Intel Corporation Inc.
*/ */
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/acpi.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/property.h> #include <linux/property.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
...@@ -148,7 +148,7 @@ static struct spi_driver inv_mpu_driver = { ...@@ -148,7 +148,7 @@ static struct spi_driver inv_mpu_driver = {
.id_table = inv_mpu_id, .id_table = inv_mpu_id,
.driver = { .driver = {
.of_match_table = inv_of_match, .of_match_table = inv_of_match,
.acpi_match_table = ACPI_PTR(inv_acpi_match), .acpi_match_table = inv_acpi_match,
.name = "inv-mpu6000-spi", .name = "inv-mpu6000-spi",
.pm = &inv_mpu_pmops, .pm = &inv_mpu_pmops,
}, },
......
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