From: Jonathan Cameron Date: Tue, 21 Jul 2020 17:14:42 +0000 (+0100) Subject: iio:adc:ti-adc108s102: Drop CONFIG_OF and of_match_ptr protections X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0a4596f5bd5ae3d234803353b14deef26663722e;p=linux.git iio:adc:ti-adc108s102: Drop CONFIG_OF and of_match_ptr protections I'm trying to clean this (now) anti-pattern out of IIO to avoid cut and paste into new drivers. Also add an include of mod_devicetable.h as the driver directly uses struct of_device_id which is defined in there. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Jan Kiszka --- diff --git a/drivers/iio/adc/ti-adc108s102.c b/drivers/iio/adc/ti-adc108s102.c index 9b9b27415c93e..183b2245e89b7 100644 --- a/drivers/iio/adc/ti-adc108s102.c +++ b/drivers/iio/adc/ti-adc108s102.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -299,13 +300,11 @@ static int adc108s102_remove(struct spi_device *spi) return 0; } -#ifdef CONFIG_OF static const struct of_device_id adc108s102_of_match[] = { { .compatible = "ti,adc108s102" }, { } }; MODULE_DEVICE_TABLE(of, adc108s102_of_match); -#endif #ifdef CONFIG_ACPI static const struct acpi_device_id adc108s102_acpi_ids[] = { @@ -324,7 +323,7 @@ MODULE_DEVICE_TABLE(spi, adc108s102_id); static struct spi_driver adc108s102_driver = { .driver = { .name = "adc108s102", - .of_match_table = of_match_ptr(adc108s102_of_match), + .of_match_table = adc108s102_of_match, .acpi_match_table = ACPI_PTR(adc108s102_acpi_ids), }, .probe = adc108s102_probe,