Skip to content

Commit

Permalink
iio: health: afe4403: retrieve a valid iio_dev in suspend/resume
Browse files Browse the repository at this point in the history
The suspend/resume functions were using dev_to_iio_dev() to get
the iio_dev. That only works on IIO dev's.  Replace it with spi
functions to get the correct iio_dev.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Acked-by: Andrew F. Davis <afd@ti.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Alison Schofield authored and Jonathan Cameron committed Jan 21, 2017
1 parent a121103 commit a5badd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/health/afe4403.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ MODULE_DEVICE_TABLE(of, afe4403_of_match);

static int __maybe_unused afe4403_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
struct afe4403_data *afe = iio_priv(indio_dev);
int ret;

Expand All @@ -443,7 +443,7 @@ static int __maybe_unused afe4403_suspend(struct device *dev)

static int __maybe_unused afe4403_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev));
struct afe4403_data *afe = iio_priv(indio_dev);
int ret;

Expand Down

0 comments on commit a5badd1

Please sign in to comment.