Commit c34bed92 authored by Jonathan Cameron's avatar Jonathan Cameron

iio:potentiometer:ds1803: 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 switch of.h for mod_devicetable.h include given use of
struct of_device_id which is defined in that header.
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20200910173242.621168-3-jic23@kernel.org
parent 19061b3c
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/mod_devicetable.h>
#define DS1803_MAX_POS 255 #define DS1803_MAX_POS 255
#define DS1803_WRITE(chan) (0xa8 | ((chan) + 1)) #define DS1803_WRITE(chan) (0xa8 | ((chan) + 1))
...@@ -134,7 +134,6 @@ static int ds1803_probe(struct i2c_client *client, ...@@ -134,7 +134,6 @@ static int ds1803_probe(struct i2c_client *client,
return devm_iio_device_register(dev, indio_dev); return devm_iio_device_register(dev, indio_dev);
} }
#if defined(CONFIG_OF)
static const struct of_device_id ds1803_dt_ids[] = { static const struct of_device_id ds1803_dt_ids[] = {
{ .compatible = "maxim,ds1803-010", .data = &ds1803_cfg[DS1803_010] }, { .compatible = "maxim,ds1803-010", .data = &ds1803_cfg[DS1803_010] },
{ .compatible = "maxim,ds1803-050", .data = &ds1803_cfg[DS1803_050] }, { .compatible = "maxim,ds1803-050", .data = &ds1803_cfg[DS1803_050] },
...@@ -142,7 +141,6 @@ static const struct of_device_id ds1803_dt_ids[] = { ...@@ -142,7 +141,6 @@ static const struct of_device_id ds1803_dt_ids[] = {
{} {}
}; };
MODULE_DEVICE_TABLE(of, ds1803_dt_ids); MODULE_DEVICE_TABLE(of, ds1803_dt_ids);
#endif /* CONFIG_OF */
static const struct i2c_device_id ds1803_id[] = { static const struct i2c_device_id ds1803_id[] = {
{ "ds1803-010", DS1803_010 }, { "ds1803-010", DS1803_010 },
...@@ -155,7 +153,7 @@ MODULE_DEVICE_TABLE(i2c, ds1803_id); ...@@ -155,7 +153,7 @@ MODULE_DEVICE_TABLE(i2c, ds1803_id);
static struct i2c_driver ds1803_driver = { static struct i2c_driver ds1803_driver = {
.driver = { .driver = {
.name = "ds1803", .name = "ds1803",
.of_match_table = of_match_ptr(ds1803_dt_ids), .of_match_table = ds1803_dt_ids,
}, },
.probe = ds1803_probe, .probe = ds1803_probe,
.id_table = ds1803_id, .id_table = ds1803_id,
......
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