Commit 17e2a542 authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman

Staging: IIO: DAC: AD5624R: Consistency cleanup - no functional changes

Consistently use indio_dev and access macro for devdata
Signed-off-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9dabb722
...@@ -77,7 +77,7 @@ static ssize_t ad5624r_write_dac(struct device *dev, ...@@ -77,7 +77,7 @@ static ssize_t ad5624r_write_dac(struct device *dev,
long readin; long readin;
int ret; int ret;
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad5624r_state *st = indio_dev->dev_data; struct ad5624r_state *st = iio_dev_get_devdata(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
ret = strict_strtol(buf, 10, &readin); ret = strict_strtol(buf, 10, &readin);
...@@ -94,7 +94,7 @@ static ssize_t ad5624r_read_powerdown_mode(struct device *dev, ...@@ -94,7 +94,7 @@ static ssize_t ad5624r_read_powerdown_mode(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad5624r_state *st = indio_dev->dev_data; struct ad5624r_state *st = iio_dev_get_devdata(indio_dev);
char mode[][15] = {"", "1kohm_to_gnd", "100kohm_to_gnd", "three_state"}; char mode[][15] = {"", "1kohm_to_gnd", "100kohm_to_gnd", "three_state"};
...@@ -106,7 +106,7 @@ static ssize_t ad5624r_write_powerdown_mode(struct device *dev, ...@@ -106,7 +106,7 @@ static ssize_t ad5624r_write_powerdown_mode(struct device *dev,
const char *buf, size_t len) const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad5624r_state *st = indio_dev->dev_data; struct ad5624r_state *st = iio_dev_get_devdata(indio_dev);
int ret; int ret;
if (sysfs_streq(buf, "1kohm_to_gnd")) if (sysfs_streq(buf, "1kohm_to_gnd"))
...@@ -126,7 +126,7 @@ static ssize_t ad5624r_read_dac_powerdown(struct device *dev, ...@@ -126,7 +126,7 @@ static ssize_t ad5624r_read_dac_powerdown(struct device *dev,
char *buf) char *buf)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad5624r_state *st = indio_dev->dev_data; struct ad5624r_state *st = iio_dev_get_devdata(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
return sprintf(buf, "%d\n", return sprintf(buf, "%d\n",
...@@ -140,7 +140,7 @@ static ssize_t ad5624r_write_dac_powerdown(struct device *dev, ...@@ -140,7 +140,7 @@ static ssize_t ad5624r_write_dac_powerdown(struct device *dev,
long readin; long readin;
int ret; int ret;
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad5624r_state *st = indio_dev->dev_data; struct ad5624r_state *st = iio_dev_get_devdata(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
ret = strict_strtol(buf, 10, &readin); ret = strict_strtol(buf, 10, &readin);
...@@ -165,8 +165,8 @@ static ssize_t ad5624r_show_scale(struct device *dev, ...@@ -165,8 +165,8 @@ static ssize_t ad5624r_show_scale(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad5624r_state *st = iio_dev_get_devdata(dev_info); struct ad5624r_state *st = iio_dev_get_devdata(indio_dev);
/* Corresponds to Vref / 2^(bits) */ /* Corresponds to Vref / 2^(bits) */
unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits; unsigned int scale_uv = (st->vref_mv * 1000) >> st->chip_info->bits;
...@@ -178,8 +178,8 @@ static ssize_t ad5624r_show_name(struct device *dev, ...@@ -178,8 +178,8 @@ static ssize_t ad5624r_show_name(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad5624r_state *st = iio_dev_get_devdata(dev_info); struct ad5624r_state *st = iio_dev_get_devdata(indio_dev);
return sprintf(buf, "%s\n", spi_get_device_id(st->us)->name); return sprintf(buf, "%s\n", spi_get_device_id(st->us)->name);
} }
......
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