Commit a51a8349 authored by Jonathan Cameron's avatar Jonathan Cameron

iio:potentiometer:mcp4131: Drop of_match_ptr and use generic fw interfaces.

This change allows the use of the driver with ACPI via PRP0001
and remove an example of an anti pattern I'm trying to remove from IIO.
Also adjust includes to reflect this change.
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-8-jic23@kernel.org
parent 6fad8ae4
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/types.h> #include <linux/iio/types.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/of.h> #include <linux/property.h>
#include <linux/of_device.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#define MCP4131_WRITE (0x00 << 2) #define MCP4131_WRITE (0x00 << 2)
...@@ -252,7 +252,7 @@ static int mcp4131_probe(struct spi_device *spi) ...@@ -252,7 +252,7 @@ static int mcp4131_probe(struct spi_device *spi)
data = iio_priv(indio_dev); data = iio_priv(indio_dev);
spi_set_drvdata(spi, indio_dev); spi_set_drvdata(spi, indio_dev);
data->spi = spi; data->spi = spi;
data->cfg = of_device_get_match_data(&spi->dev); data->cfg = device_get_match_data(&spi->dev);
if (!data->cfg) { if (!data->cfg) {
devid = spi_get_device_id(spi)->driver_data; devid = spi_get_device_id(spi)->driver_data;
data->cfg = &mcp4131_cfg[devid]; data->cfg = &mcp4131_cfg[devid];
...@@ -479,7 +479,7 @@ MODULE_DEVICE_TABLE(spi, mcp4131_id); ...@@ -479,7 +479,7 @@ MODULE_DEVICE_TABLE(spi, mcp4131_id);
static struct spi_driver mcp4131_driver = { static struct spi_driver mcp4131_driver = {
.driver = { .driver = {
.name = "mcp4131", .name = "mcp4131",
.of_match_table = of_match_ptr(mcp4131_dt_ids), .of_match_table = mcp4131_dt_ids,
}, },
.probe = mcp4131_probe, .probe = mcp4131_probe,
.id_table = mcp4131_id, .id_table = mcp4131_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