Commit dae013af authored by Wolfram Sang's avatar Wolfram Sang Committed by Jonathan Cameron

staging: iio: adc: simplify getting .drvdata

We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent ebbdcba2
...@@ -18,8 +18,7 @@ ...@@ -18,8 +18,7 @@
static int ad7606_par16_read_block(struct device *dev, static int ad7606_par16_read_block(struct device *dev,
int count, void *buf) int count, void *buf)
{ {
struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct ad7606_state *st = iio_priv(indio_dev); struct ad7606_state *st = iio_priv(indio_dev);
insw((unsigned long)st->base_address, buf, count); insw((unsigned long)st->base_address, buf, count);
...@@ -34,8 +33,7 @@ static const struct ad7606_bus_ops ad7606_par16_bops = { ...@@ -34,8 +33,7 @@ static const struct ad7606_bus_ops ad7606_par16_bops = {
static int ad7606_par8_read_block(struct device *dev, static int ad7606_par8_read_block(struct device *dev,
int count, void *buf) int count, void *buf)
{ {
struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct ad7606_state *st = iio_priv(indio_dev); struct ad7606_state *st = iio_priv(indio_dev);
insb((unsigned long)st->base_address, buf, count * 2); insb((unsigned long)st->base_address, buf, count * 2);
......
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