summaryrefslogtreecommitdiff
path: root/drivers/iio/potentiometer/max5481.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/potentiometer/max5481.c')
-rw-r--r--drivers/iio/potentiometer/max5481.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/iio/potentiometer/max5481.c b/drivers/iio/potentiometer/max5481.c
index ffe2761333a2..6d2f13fa5662 100644
--- a/drivers/iio/potentiometer/max5481.c
+++ b/drivers/iio/potentiometer/max5481.c
@@ -137,7 +137,6 @@ static int max5481_probe(struct spi_device *spi)
struct iio_dev *indio_dev;
struct max5481_data *data;
const struct spi_device_id *id = spi_get_device_id(spi);
- const struct of_device_id *match;
int ret;
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*data));
@@ -149,10 +148,8 @@ static int max5481_probe(struct spi_device *spi)
data->spi = spi;
- match = of_match_device(of_match_ptr(max5481_match), &spi->dev);
- if (match)
- data->cfg = of_device_get_match_data(&spi->dev);
- else
+ data->cfg = of_device_get_match_data(&spi->dev);
+ if (!data->cfg)
data->cfg = &max5481_cfg[id->driver_data];
indio_dev->name = id->name;