Skip to content

Commit

Permalink
iio: exynos_adc: fix wrong structure extration in suspend and resume
Browse files Browse the repository at this point in the history
The exynos_adc device structure was wrongly extracted from the dev*
correcting the same.

Using the regular conversion of
struct device* -> struct platform_device* -> struct exynos_adc* seems wrong.
Instead we should be doing
struct device* -> struct iio_dev* -> struct exynos_adc*

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Naveen Krishna Chatradhi authored and Jonathan Cameron committed May 22, 2013
1 parent d61a04d commit 927b4dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/iio/adc/exynos_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ static int exynos_adc_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int exynos_adc_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos_adc *info = platform_get_drvdata(pdev);
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct exynos_adc *info = iio_priv(indio_dev);
u32 con;

if (info->version == ADC_V2) {
Expand All @@ -413,8 +413,8 @@ static int exynos_adc_suspend(struct device *dev)

static int exynos_adc_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos_adc *info = platform_get_drvdata(pdev);
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct exynos_adc *info = iio_priv(indio_dev);
int ret;

ret = regulator_enable(info->vdd);
Expand Down

0 comments on commit 927b4dc

Please sign in to comment.