Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Slawomir Stepien <sst@poczta.fm>
Link: https://lore.kernel.org/r/20200910173242.621168-8-jic23@kernel.org

+4 -4
+4 -4
drivers/iio/potentiometer/mcp4131.c
··· 37 37 #include <linux/iio/iio.h> 38 38 #include <linux/iio/types.h> 39 39 #include <linux/module.h> 40 + #include <linux/mod_devicetable.h> 40 41 #include <linux/mutex.h> 41 - #include <linux/of.h> 42 - #include <linux/of_device.h> 42 + #include <linux/property.h> 43 43 #include <linux/spi/spi.h> 44 44 45 45 #define MCP4131_WRITE (0x00 << 2) ··· 252 252 data = iio_priv(indio_dev); 253 253 spi_set_drvdata(spi, indio_dev); 254 254 data->spi = spi; 255 - data->cfg = of_device_get_match_data(&spi->dev); 255 + data->cfg = device_get_match_data(&spi->dev); 256 256 if (!data->cfg) { 257 257 devid = spi_get_device_id(spi)->driver_data; 258 258 data->cfg = &mcp4131_cfg[devid]; ··· 479 479 static struct spi_driver mcp4131_driver = { 480 480 .driver = { 481 481 .name = "mcp4131", 482 - .of_match_table = of_match_ptr(mcp4131_dt_ids), 482 + .of_match_table = mcp4131_dt_ids, 483 483 }, 484 484 .probe = mcp4131_probe, 485 485 .id_table = mcp4131_id,