aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/potentiometer
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2020-09-10 18:32:05 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-09-17 19:13:34 +0100
commit19061b3c590d20ed555cbe848427ef5e69d18559 (patch)
tree7284562e2b19ab4df95245209625841ebed96320 /drivers/iio/potentiometer
parentiio:imu:adis16400: Sort out missing kernel doc. (diff)
downloadlinux-dev-19061b3c590d20ed555cbe848427ef5e69d18559.tar.xz
linux-dev-19061b3c590d20ed555cbe848427ef5e69d18559.zip
iio:potentiometer:ad5272: Drop of_match_ptr and CONFIG_OF protections.
These prevent use of this driver with ACPI via PRP0001 and are an example of an anti pattern I'm trying to remove from IIO. Drop them to remove this restriction. Also added mod_devicetable.h include given use of struct of_device_id which is defined in that header. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Phil Reid <preid@eletromag.com.au> Link: https://lore.kernel.org/r/20200910173242.621168-2-jic23@kernel.org
Diffstat (limited to 'drivers/iio/potentiometer')
-rw-r--r--drivers/iio/potentiometer/ad5272.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/iio/potentiometer/ad5272.c b/drivers/iio/potentiometer/ad5272.c
index 933afcf7e925..70c45d346df0 100644
--- a/drivers/iio/potentiometer/ad5272.c
+++ b/drivers/iio/potentiometer/ad5272.c
@@ -15,6 +15,7 @@
#include <linux/i2c.h>
#include <linux/iio/iio.h>
#include <linux/module.h>
+#include <linux/mod_devicetable.h>
#define AD5272_RDAC_WR 1
#define AD5272_RDAC_RD 2
@@ -192,7 +193,6 @@ static int ad5272_probe(struct i2c_client *client,
return devm_iio_device_register(dev, indio_dev);
}
-#if defined(CONFIG_OF)
static const struct of_device_id ad5272_dt_ids[] = {
{ .compatible = "adi,ad5272-020", .data = (void *)AD5272_020 },
{ .compatible = "adi,ad5272-050", .data = (void *)AD5272_050 },
@@ -202,7 +202,6 @@ static const struct of_device_id ad5272_dt_ids[] = {
{}
};
MODULE_DEVICE_TABLE(of, ad5272_dt_ids);
-#endif /* CONFIG_OF */
static const struct i2c_device_id ad5272_id[] = {
{ "ad5272-020", AD5272_020 },
@@ -217,7 +216,7 @@ MODULE_DEVICE_TABLE(i2c, ad5272_id);
static struct i2c_driver ad5272_driver = {
.driver = {
.name = "ad5272",
- .of_match_table = of_match_ptr(ad5272_dt_ids),
+ .of_match_table = ad5272_dt_ids,
},
.probe = ad5272_probe,
.id_table = ad5272_id,