From 2d815b84156e9888b851f2892d7b0075b1e972ae Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 16 Jul 2020 14:59:00 +0100 Subject: iio: accel: bma220_spi: Do not define 'struct acpi_device_id' when !CONFIG_ACPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, struct 'bma220_acpi_id' becomes defined but unused. Fixes the following W=1 kernel build warning(s): drivers/iio/accel/bma220_spi.c:312:36: warning: ‘bma220_acpi_id’ defined but not used [-Wunused-const-variable=] 312 | static const struct acpi_device_id bma220_acpi_id[] = { | ^~~~~~~~~~~~~~ Cc: Tiberiu Breana Signed-off-by: Lee Jones Signed-off-by: Jonathan Cameron --- drivers/iio/accel/bma220_spi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/iio/accel') diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index cce8324394f5..da8b36cc8628 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -308,12 +308,14 @@ static const struct spi_device_id bma220_spi_id[] = { {} }; +#ifdef CONFIG_ACPI static const struct acpi_device_id bma220_acpi_id[] = { {"BMA0220", 0}, {} }; MODULE_DEVICE_TABLE(spi, bma220_spi_id); +#endif static struct spi_driver bma220_driver = { .driver = { -- cgit v1.2.3