diff options
Diffstat (limited to 'drivers/iio/potentiometer')
-rw-r--r-- | drivers/iio/potentiometer/ad5272.c | 5 | ||||
-rw-r--r-- | drivers/iio/potentiometer/ds1803.c | 6 | ||||
-rw-r--r-- | drivers/iio/potentiometer/max5432.c | 8 | ||||
-rw-r--r-- | drivers/iio/potentiometer/max5481.c | 23 | ||||
-rw-r--r-- | drivers/iio/potentiometer/mcp4018.c | 12 | ||||
-rw-r--r-- | drivers/iio/potentiometer/mcp4131.c | 8 | ||||
-rw-r--r-- | drivers/iio/potentiometer/mcp4531.c | 11 |
7 files changed, 24 insertions, 49 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, diff --git a/drivers/iio/potentiometer/ds1803.c b/drivers/iio/potentiometer/ds1803.c index 5c061ab8f46c..20b45407eaac 100644 --- a/drivers/iio/potentiometer/ds1803.c +++ b/drivers/iio/potentiometer/ds1803.c @@ -14,7 +14,7 @@ #include <linux/i2c.h> #include <linux/iio/iio.h> #include <linux/module.h> -#include <linux/of.h> +#include <linux/mod_devicetable.h> #define DS1803_MAX_POS 255 #define DS1803_WRITE(chan) (0xa8 | ((chan) + 1)) @@ -134,7 +134,6 @@ static int ds1803_probe(struct i2c_client *client, return devm_iio_device_register(dev, indio_dev); } -#if defined(CONFIG_OF) static const struct of_device_id ds1803_dt_ids[] = { { .compatible = "maxim,ds1803-010", .data = &ds1803_cfg[DS1803_010] }, { .compatible = "maxim,ds1803-050", .data = &ds1803_cfg[DS1803_050] }, @@ -142,7 +141,6 @@ static const struct of_device_id ds1803_dt_ids[] = { {} }; MODULE_DEVICE_TABLE(of, ds1803_dt_ids); -#endif /* CONFIG_OF */ static const struct i2c_device_id ds1803_id[] = { { "ds1803-010", DS1803_010 }, @@ -155,7 +153,7 @@ MODULE_DEVICE_TABLE(i2c, ds1803_id); static struct i2c_driver ds1803_driver = { .driver = { .name = "ds1803", - .of_match_table = of_match_ptr(ds1803_dt_ids), + .of_match_table = ds1803_dt_ids, }, .probe = ds1803_probe, .id_table = ds1803_id, diff --git a/drivers/iio/potentiometer/max5432.c b/drivers/iio/potentiometer/max5432.c index 280de9c54471..aed3b6ab82a2 100644 --- a/drivers/iio/potentiometer/max5432.c +++ b/drivers/iio/potentiometer/max5432.c @@ -11,8 +11,8 @@ #include <linux/iio/iio.h> #include <linux/limits.h> #include <linux/module.h> -#include <linux/of.h> -#include <linux/of_device.h> +#include <linux/mod_devicetable.h> +#include <linux/property.h> /* All chip variants have 32 wiper positions. */ #define MAX5432_MAX_POS 31 @@ -100,7 +100,7 @@ static int max5432_probe(struct i2c_client *client, data = iio_priv(indio_dev); data->client = client; - data->ohm = (unsigned long)of_device_get_match_data(dev); + data->ohm = (unsigned long)device_get_match_data(dev); indio_dev->info = &max5432_info; indio_dev->channels = max5432_channels; @@ -122,7 +122,7 @@ MODULE_DEVICE_TABLE(of, max5432_dt_ids); static struct i2c_driver max5432_driver = { .driver = { .name = "max5432", - .of_match_table = of_match_ptr(max5432_dt_ids), + .of_match_table = max5432_dt_ids, }, .probe = max5432_probe, }; diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c index 5f5988189796..a88ed0eb3adc 100644 --- a/drivers/iio/potentiometer/max5481.c +++ b/drivers/iio/potentiometer/max5481.c @@ -7,12 +7,11 @@ * https://datasheets.maximintegrated.com/en/ds/MAX5481-MAX5484.pdf */ -#include <linux/acpi.h> #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> #include <linux/module.h> -#include <linux/of.h> -#include <linux/of_device.h> +#include <linux/mod_devicetable.h> +#include <linux/property.h> #include <linux/spi/spi.h> /* write wiper reg */ @@ -117,7 +116,6 @@ static const struct iio_info max5481_info = { .write_raw = max5481_write_raw, }; -#if defined(CONFIG_OF) static const struct of_device_id max5481_match[] = { { .compatible = "maxim,max5481", .data = &max5481_cfg[max5481] }, { .compatible = "maxim,max5482", .data = &max5481_cfg[max5482] }, @@ -126,7 +124,6 @@ static const struct of_device_id max5481_match[] = { { } }; MODULE_DEVICE_TABLE(of, max5481_match); -#endif static int max5481_probe(struct spi_device *spi) { @@ -144,7 +141,7 @@ static int max5481_probe(struct spi_device *spi) data->spi = spi; - data->cfg = of_device_get_match_data(&spi->dev); + data->cfg = device_get_match_data(&spi->dev); if (!data->cfg) data->cfg = &max5481_cfg[id->driver_data]; @@ -184,22 +181,10 @@ static const struct spi_device_id max5481_id_table[] = { }; MODULE_DEVICE_TABLE(spi, max5481_id_table); -#if defined(CONFIG_ACPI) -static const struct acpi_device_id max5481_acpi_match[] = { - { "max5481", max5481 }, - { "max5482", max5482 }, - { "max5483", max5483 }, - { "max5484", max5484 }, - { } -}; -MODULE_DEVICE_TABLE(acpi, max5481_acpi_match); -#endif - static struct spi_driver max5481_driver = { .driver = { .name = "max5481", - .of_match_table = of_match_ptr(max5481_match), - .acpi_match_table = ACPI_PTR(max5481_acpi_match), + .of_match_table = max5481_match, }, .probe = max5481_probe, .remove = max5481_remove, diff --git a/drivers/iio/potentiometer/mcp4018.c b/drivers/iio/potentiometer/mcp4018.c index fd0579ad3c83..c0e171fec062 100644 --- a/drivers/iio/potentiometer/mcp4018.c +++ b/drivers/iio/potentiometer/mcp4018.c @@ -16,8 +16,8 @@ #include <linux/i2c.h> #include <linux/iio/iio.h> #include <linux/module.h> -#include <linux/of.h> -#include <linux/of_device.h> +#include <linux/mod_devicetable.h> +#include <linux/property.h> #define MCP4018_WIPER_MAX 127 @@ -116,8 +116,6 @@ static const struct i2c_device_id mcp4018_id[] = { }; MODULE_DEVICE_TABLE(i2c, mcp4018_id); -#ifdef CONFIG_OF - #define MCP4018_COMPATIBLE(of_compatible, cfg) { \ .compatible = of_compatible, \ .data = &mcp4018_cfg[cfg], \ @@ -140,8 +138,6 @@ static const struct of_device_id mcp4018_of_match[] = { }; MODULE_DEVICE_TABLE(of, mcp4018_of_match); -#endif - static int mcp4018_probe(struct i2c_client *client) { struct device *dev = &client->dev; @@ -161,7 +157,7 @@ static int mcp4018_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; - data->cfg = of_device_get_match_data(dev); + data->cfg = device_get_match_data(dev); if (!data->cfg) data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)->driver_data]; @@ -176,7 +172,7 @@ static int mcp4018_probe(struct i2c_client *client) static struct i2c_driver mcp4018_driver = { .driver = { .name = "mcp4018", - .of_match_table = of_match_ptr(mcp4018_of_match), + .of_match_table = mcp4018_of_match, }, .probe_new = mcp4018_probe, .id_table = mcp4018_id, diff --git a/drivers/iio/potentiometer/mcp4131.c b/drivers/iio/potentiometer/mcp4131.c index 2923ce250fc3..7c8c18ab8764 100644 --- a/drivers/iio/potentiometer/mcp4131.c +++ b/drivers/iio/potentiometer/mcp4131.c @@ -37,9 +37,9 @@ #include <linux/iio/iio.h> #include <linux/iio/types.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/mutex.h> -#include <linux/of.h> -#include <linux/of_device.h> +#include <linux/property.h> #include <linux/spi/spi.h> #define MCP4131_WRITE (0x00 << 2) @@ -252,7 +252,7 @@ static int mcp4131_probe(struct spi_device *spi) data = iio_priv(indio_dev); spi_set_drvdata(spi, indio_dev); data->spi = spi; - data->cfg = of_device_get_match_data(&spi->dev); + data->cfg = device_get_match_data(&spi->dev); if (!data->cfg) { devid = spi_get_device_id(spi)->driver_data; data->cfg = &mcp4131_cfg[devid]; @@ -479,7 +479,7 @@ MODULE_DEVICE_TABLE(spi, mcp4131_id); static struct spi_driver mcp4131_driver = { .driver = { .name = "mcp4131", - .of_match_table = of_match_ptr(mcp4131_dt_ids), + .of_match_table = mcp4131_dt_ids, }, .probe = mcp4131_probe, .id_table = mcp4131_id, diff --git a/drivers/iio/potentiometer/mcp4531.c b/drivers/iio/potentiometer/mcp4531.c index 95efc4b40514..c25f84b4a270 100644 --- a/drivers/iio/potentiometer/mcp4531.c +++ b/drivers/iio/potentiometer/mcp4531.c @@ -28,8 +28,8 @@ #include <linux/module.h> #include <linux/i2c.h> #include <linux/err.h> -#include <linux/of.h> -#include <linux/of_device.h> +#include <linux/mod_devicetable.h> +#include <linux/property.h> #include <linux/iio/iio.h> @@ -275,8 +275,6 @@ static const struct i2c_device_id mcp4531_id[] = { }; MODULE_DEVICE_TABLE(i2c, mcp4531_id); -#ifdef CONFIG_OF - #define MCP4531_COMPATIBLE(of_compatible, cfg) { \ .compatible = of_compatible, \ .data = &mcp4531_cfg[cfg], \ @@ -350,7 +348,6 @@ static const struct of_device_id mcp4531_of_match[] = { { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, mcp4531_of_match); -#endif static int mcp4531_probe(struct i2c_client *client) { @@ -371,7 +368,7 @@ static int mcp4531_probe(struct i2c_client *client) i2c_set_clientdata(client, indio_dev); data->client = client; - data->cfg = of_device_get_match_data(dev); + data->cfg = device_get_match_data(dev); if (!data->cfg) data->cfg = &mcp4531_cfg[i2c_match_id(mcp4531_id, client)->driver_data]; @@ -386,7 +383,7 @@ static int mcp4531_probe(struct i2c_client *client) static struct i2c_driver mcp4531_driver = { .driver = { .name = "mcp4531", - .of_match_table = of_match_ptr(mcp4531_of_match), + .of_match_table = mcp4531_of_match, }, .probe_new = mcp4531_probe, .id_table = mcp4531_id, |