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

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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220203155920.18586-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
c53c7740 08f5fbf0

+5 -6
+3 -4
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
··· 3 3 * Copyright (C) 2012 Invensense, Inc. 4 4 */ 5 5 6 - #include <linux/acpi.h> 7 6 #include <linux/delay.h> 8 7 #include <linux/err.h> 9 8 #include <linux/i2c.h> 10 9 #include <linux/iio/iio.h> 10 + #include <linux/mod_devicetable.h> 11 11 #include <linux/module.h> 12 12 #include <linux/of_device.h> 13 13 #include <linux/property.h> ··· 249 249 }; 250 250 MODULE_DEVICE_TABLE(of, inv_of_match); 251 251 252 - static const struct acpi_device_id __maybe_unused inv_acpi_match[] = { 252 + static const struct acpi_device_id inv_acpi_match[] = { 253 253 {"INVN6500", INV_MPU6500}, 254 254 { }, 255 255 }; 256 - 257 256 MODULE_DEVICE_TABLE(acpi, inv_acpi_match); 258 257 259 258 static struct i2c_driver inv_mpu_driver = { ··· 261 262 .id_table = inv_mpu_id, 262 263 .driver = { 263 264 .of_match_table = inv_of_match, 264 - .acpi_match_table = ACPI_PTR(inv_acpi_match), 265 + .acpi_match_table = inv_acpi_match, 265 266 .name = "inv-mpu6050-i2c", 266 267 .pm = &inv_mpu_pmops, 267 268 },
+2 -2
drivers/iio/imu/inv_mpu6050/inv_mpu_spi.c
··· 2 2 /* 3 3 * Copyright (C) 2015 Intel Corporation Inc. 4 4 */ 5 + #include <linux/mod_devicetable.h> 5 6 #include <linux/module.h> 6 - #include <linux/acpi.h> 7 7 #include <linux/of.h> 8 8 #include <linux/property.h> 9 9 #include <linux/spi/spi.h> ··· 148 148 .id_table = inv_mpu_id, 149 149 .driver = { 150 150 .of_match_table = inv_of_match, 151 - .acpi_match_table = ACPI_PTR(inv_acpi_match), 151 + .acpi_match_table = inv_acpi_match, 152 152 .name = "inv-mpu6000-spi", 153 153 .pm = &inv_mpu_pmops, 154 154 },