summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/at91-sama5d2_adc.c
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2019-04-23 15:50:03 +0800
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-04-27 13:07:12 +0100
commite3faedf71d881780c2b8f6548aaacfad7f0a8372 (patch)
treec23c2f6d70f08e80ec27316286acd13305f02d4a /drivers/iio/adc/at91-sama5d2_adc.c
parent575d927c426b83f5f8d5809f46de177cceffe40c (diff)
downloadlwn-e3faedf71d881780c2b8f6548aaacfad7f0a8372.tar.gz
lwn-e3faedf71d881780c2b8f6548aaacfad7f0a8372.zip
iio: adc: at91: Use dev_get_drvdata()
Using dev_get_drvdata directly. Cc: Ludovic Desroches <ludovic.desroches@microchip.com> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: linux-iio@vger.kernel.org Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/at91-sama5d2_adc.c')
-rw-r--r--drivers/iio/adc/at91-sama5d2_adc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index d5ea84cf6460..a3a4ca946308 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -1586,8 +1586,7 @@ static void at91_adc_hw_init(struct at91_adc_state *st)
static ssize_t at91_adc_get_fifo_state(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct iio_dev *indio_dev =
- platform_get_drvdata(to_platform_device(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct at91_adc_state *st = iio_priv(indio_dev);
return scnprintf(buf, PAGE_SIZE, "%d\n", !!st->dma_st.dma_chan);
@@ -1596,8 +1595,7 @@ static ssize_t at91_adc_get_fifo_state(struct device *dev,
static ssize_t at91_adc_get_watermark(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct iio_dev *indio_dev =
- platform_get_drvdata(to_platform_device(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct at91_adc_state *st = iio_priv(indio_dev);
return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark);
@@ -1849,8 +1847,7 @@ static int at91_adc_remove(struct platform_device *pdev)
static __maybe_unused int at91_adc_suspend(struct device *dev)
{
- struct iio_dev *indio_dev =
- platform_get_drvdata(to_platform_device(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct at91_adc_state *st = iio_priv(indio_dev);
/*
@@ -1870,8 +1867,7 @@ static __maybe_unused int at91_adc_suspend(struct device *dev)
static __maybe_unused int at91_adc_resume(struct device *dev)
{
- struct iio_dev *indio_dev =
- platform_get_drvdata(to_platform_device(dev));
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct at91_adc_state *st = iio_priv(indio_dev);
int ret;