Commit ad49bd57 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Jonathan Cameron

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: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200930135048.11530-2-alexandru.ardelean@analog.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent d93dd060
...@@ -829,8 +829,6 @@ static u32 calc_startup_ticks_9x5(u32 startup_time, u32 adc_clk_khz) ...@@ -829,8 +829,6 @@ static u32 calc_startup_ticks_9x5(u32 startup_time, u32 adc_clk_khz)
return ticks; return ticks;
} }
static const struct of_device_id at91_adc_dt_ids[];
static int at91_adc_probe_dt_ts(struct device_node *node, static int at91_adc_probe_dt_ts(struct device_node *node,
struct at91_adc_state *st, struct device *dev) struct at91_adc_state *st, struct device *dev)
{ {
...@@ -878,8 +876,7 @@ static int at91_adc_probe_dt(struct iio_dev *idev, ...@@ -878,8 +876,7 @@ static int at91_adc_probe_dt(struct iio_dev *idev,
if (!node) if (!node)
return -EINVAL; return -EINVAL;
st->caps = (struct at91_adc_caps *) st->caps = (struct at91_adc_caps *)of_device_get_match_data(&pdev->dev);
of_match_device(at91_adc_dt_ids, &pdev->dev)->data;
st->use_external = of_property_read_bool(node, "atmel,adc-use-external-triggers"); st->use_external = of_property_read_bool(node, "atmel,adc-use-external-triggers");
......
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