From: Lars-Peter Clausen Date: Sat, 12 May 2012 13:39:50 +0000 (+0200) Subject: staging:iio:imu: Use dev_to_iio_dev() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=dedb1e77aabaad8d91c1aad5f92f127cecd27c3f;p=linux-beck.git staging:iio:imu: Use dev_to_iio_dev() Replace open-coded instances of getting a iio_dev struct from a device struct with dev_to_iio_dev(). Signed-off-by: Lars-Peter Clausen Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c index 5015f823b65f..1f6bd854e950 100644 --- a/drivers/staging/iio/imu/adis16400_core.c +++ b/drivers/staging/iio/imu/adis16400_core.c @@ -179,7 +179,7 @@ static ssize_t adis16400_read_frequency(struct device *dev, struct device_attribute *attr, char *buf) { - struct iio_dev *indio_dev = dev_get_drvdata(dev); + struct iio_dev *indio_dev = dev_to_iio_dev(dev); int ret, len = 0; ret = adis16400_get_freq(indio_dev); if (ret < 0) @@ -225,7 +225,7 @@ static ssize_t adis16400_write_frequency(struct device *dev, const char *buf, size_t len) { - struct iio_dev *indio_dev = dev_get_drvdata(dev); + struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct adis16400_state *st = iio_priv(indio_dev); long val; int ret; @@ -279,7 +279,7 @@ static ssize_t adis16400_write_reset(struct device *dev, if (ret < 0) return ret; if (val) { - ret = adis16400_reset(dev_get_drvdata(dev)); + ret = adis16400_reset(dev_to_iio_dev(dev)); if (ret < 0) return ret; }