summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/at91_adc.c
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2020-09-30 16:50:45 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-10-10 17:04:58 +0100
commitad49bd57f9d574ddc859994db3ba996014e555e0 (patch)
tree3ad8d2b3f49507b7e197e2d1968db415ecba61e4 /drivers/iio/adc/at91_adc.c
parentd93dd060809f3db32ef3198121989e26e3049e00 (diff)
iio: adc: at91_adc: use of_device_get_match_data() helper
This is a small tidy-up. The of_device_get_match_data() helper retrieves the driver data from the OF table, without needed to explicitly know the table variable (since it can retrieve it from the driver object). Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20200930135048.11530-2-alexandru.ardelean@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/at91_adc.c')
-rw-r--r--drivers/iio/adc/at91_adc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 9b2c548fae95..c9ec0a4a357e 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -829,8 +829,6 @@ static u32 calc_startup_ticks_9x5(u32 startup_time, u32 adc_clk_khz)
return ticks;
}
-static const struct of_device_id at91_adc_dt_ids[];
-
static int at91_adc_probe_dt_ts(struct device_node *node,
struct at91_adc_state *st, struct device *dev)
{
@@ -878,8 +876,7 @@ static int at91_adc_probe_dt(struct iio_dev *idev,
if (!node)
return -EINVAL;
- st->caps = (struct at91_adc_caps *)
- of_match_device(at91_adc_dt_ids, &pdev->dev)->data;
+ st->caps = (struct at91_adc_caps *)of_device_get_match_data(&pdev->dev);
st->use_external = of_property_read_bool(node, "atmel,adc-use-external-triggers");