Commit 84f79ecb authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio:adc:naming: dev_info to indio_dev for consistency

We had a random missmatch of these two.  Lets pick the most common
and get rid of the other.
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2579a0df
...@@ -341,8 +341,8 @@ static ssize_t ad7150_show_timeout(struct device *dev, ...@@ -341,8 +341,8 @@ static ssize_t ad7150_show_timeout(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 ad7150_chip_info *chip = iio_priv(dev_info); struct ad7150_chip_info *chip = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
u8 value; u8 value;
......
...@@ -842,8 +842,8 @@ static mode_t ad7192_attr_is_visible(struct kobject *kobj, ...@@ -842,8 +842,8 @@ static mode_t ad7192_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n) struct attribute *attr, int n)
{ {
struct device *dev = container_of(kobj, struct device, kobj); struct device *dev = container_of(kobj, struct device, kobj);
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7192_state *st = iio_priv(dev_info); struct ad7192_state *st = iio_priv(indio_dev);
mode_t mode = attr->mode; mode_t mode = attr->mode;
......
...@@ -383,8 +383,8 @@ static ssize_t ad7280_show_balance_sw(struct device *dev, ...@@ -383,8 +383,8 @@ static ssize_t ad7280_show_balance_sw(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 ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(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",
...@@ -397,8 +397,8 @@ static ssize_t ad7280_store_balance_sw(struct device *dev, ...@@ -397,8 +397,8 @@ static ssize_t ad7280_store_balance_sw(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
bool readin; bool readin;
int ret; int ret;
...@@ -411,7 +411,7 @@ static ssize_t ad7280_store_balance_sw(struct device *dev, ...@@ -411,7 +411,7 @@ static ssize_t ad7280_store_balance_sw(struct device *dev,
devaddr = this_attr->address >> 8; devaddr = this_attr->address >> 8;
ch = this_attr->address & 0xFF; ch = this_attr->address & 0xFF;
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
if (readin) if (readin)
st->cb_mask[devaddr] |= 1 << (ch + 2); st->cb_mask[devaddr] |= 1 << (ch + 2);
else else
...@@ -419,7 +419,7 @@ static ssize_t ad7280_store_balance_sw(struct device *dev, ...@@ -419,7 +419,7 @@ static ssize_t ad7280_store_balance_sw(struct device *dev,
ret = ad7280_write(st, devaddr, AD7280A_CELL_BALANCE, ret = ad7280_write(st, devaddr, AD7280A_CELL_BALANCE,
0, st->cb_mask[devaddr]); 0, st->cb_mask[devaddr]);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
return ret ? ret : len; return ret ? ret : len;
} }
...@@ -428,16 +428,16 @@ static ssize_t ad7280_show_balance_timer(struct device *dev, ...@@ -428,16 +428,16 @@ static ssize_t ad7280_show_balance_timer(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 ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
int ret; int ret;
unsigned msecs; unsigned msecs;
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
ret = ad7280_read(st, this_attr->address >> 8, ret = ad7280_read(st, this_attr->address >> 8,
this_attr->address & 0xFF); this_attr->address & 0xFF);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -452,8 +452,8 @@ static ssize_t ad7280_store_balance_timer(struct device *dev, ...@@ -452,8 +452,8 @@ static ssize_t ad7280_store_balance_timer(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
long val; long val;
int ret; int ret;
...@@ -467,11 +467,11 @@ static ssize_t ad7280_store_balance_timer(struct device *dev, ...@@ -467,11 +467,11 @@ static ssize_t ad7280_store_balance_timer(struct device *dev,
if (val > 31) if (val > 31)
return -EINVAL; return -EINVAL;
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
ret = ad7280_write(st, this_attr->address >> 8, ret = ad7280_write(st, this_attr->address >> 8,
this_attr->address & 0xFF, this_attr->address & 0xFF,
0, (val & 0x1F) << 3); 0, (val & 0x1F) << 3);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
return ret ? ret : len; return ret ? ret : len;
} }
...@@ -595,8 +595,8 @@ static ssize_t ad7280_read_channel_config(struct device *dev, ...@@ -595,8 +595,8 @@ static ssize_t ad7280_read_channel_config(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 ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
unsigned val; unsigned val;
...@@ -625,8 +625,8 @@ static ssize_t ad7280_write_channel_config(struct device *dev, ...@@ -625,8 +625,8 @@ static ssize_t ad7280_write_channel_config(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
long val; long val;
...@@ -651,7 +651,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev, ...@@ -651,7 +651,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev,
val = clamp(val, 0L, 0xFFL); val = clamp(val, 0L, 0xFFL);
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
switch (this_attr->address) { switch (this_attr->address) {
case AD7280A_CELL_OVERVOLTAGE: case AD7280A_CELL_OVERVOLTAGE:
st->cell_threshhigh = val; st->cell_threshhigh = val;
...@@ -670,15 +670,15 @@ static ssize_t ad7280_write_channel_config(struct device *dev, ...@@ -670,15 +670,15 @@ static ssize_t ad7280_write_channel_config(struct device *dev,
ret = ad7280_write(st, AD7280A_DEVADDR_MASTER, ret = ad7280_write(st, AD7280A_DEVADDR_MASTER,
this_attr->address, 1, val); this_attr->address, 1, val);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
return ret ? ret : len; return ret ? ret : len;
} }
static irqreturn_t ad7280_event_handler(int irq, void *private) static irqreturn_t ad7280_event_handler(int irq, void *private)
{ {
struct iio_dev *dev_info = private; struct iio_dev *indio_dev = private;
struct ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(indio_dev);
unsigned *channels; unsigned *channels;
int i, ret; int i, ret;
...@@ -694,7 +694,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) ...@@ -694,7 +694,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) { if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
if (((channels[i] >> 11) & 0xFFF) >= if (((channels[i] >> 11) & 0xFFF) >=
st->cell_threshhigh) st->cell_threshhigh)
iio_push_event(dev_info, iio_push_event(indio_dev,
IIO_EVENT_CODE(IIO_VOLTAGE, IIO_EVENT_CODE(IIO_VOLTAGE,
1, 1,
0, 0,
...@@ -704,7 +704,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) ...@@ -704,7 +704,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
iio_get_time_ns()); iio_get_time_ns());
else if (((channels[i] >> 11) & 0xFFF) <= else if (((channels[i] >> 11) & 0xFFF) <=
st->cell_threshlow) st->cell_threshlow)
iio_push_event(dev_info, iio_push_event(indio_dev,
IIO_EVENT_CODE(IIO_VOLTAGE, IIO_EVENT_CODE(IIO_VOLTAGE,
1, 1,
0, 0,
...@@ -714,7 +714,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) ...@@ -714,7 +714,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
iio_get_time_ns()); iio_get_time_ns());
} else { } else {
if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh) if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh)
iio_push_event(dev_info, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0, 0,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
...@@ -722,7 +722,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) ...@@ -722,7 +722,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
iio_get_time_ns()); iio_get_time_ns());
else if (((channels[i] >> 11) & 0xFFF) <= else if (((channels[i] >> 11) & 0xFFF) <=
st->aux_threshlow) st->aux_threshlow)
iio_push_event(dev_info, iio_push_event(indio_dev,
IIO_UNMOD_EVENT_CODE(IIO_TEMP, IIO_UNMOD_EVENT_CODE(IIO_TEMP,
0, 0,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
...@@ -775,25 +775,25 @@ static struct attribute_group ad7280_event_attrs_group = { ...@@ -775,25 +775,25 @@ static struct attribute_group ad7280_event_attrs_group = {
.attrs = ad7280_event_attributes, .attrs = ad7280_event_attributes,
}; };
static int ad7280_read_raw(struct iio_dev *dev_info, static int ad7280_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, struct iio_chan_spec const *chan,
int *val, int *val,
int *val2, int *val2,
long m) long m)
{ {
struct ad7280_state *st = iio_priv(dev_info); struct ad7280_state *st = iio_priv(indio_dev);
unsigned int scale_uv; unsigned int scale_uv;
int ret; int ret;
switch (m) { switch (m) {
case 0: case 0:
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
if (chan->address == AD7280A_ALL_CELLS) if (chan->address == AD7280A_ALL_CELLS)
ret = ad7280_read_all_channels(st, st->scan_cnt, NULL); ret = ad7280_read_all_channels(st, st->scan_cnt, NULL);
else else
ret = ad7280_read_channel(st, chan->address >> 8, ret = ad7280_read_channel(st, chan->address >> 8,
chan->address & 0xFF); chan->address & 0xFF);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -131,8 +131,8 @@ static ssize_t ad7291_store_reset(struct device *dev, ...@@ -131,8 +131,8 @@ static ssize_t ad7291_store_reset(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7291_chip_info *chip = iio_priv(dev_info); struct ad7291_chip_info *chip = iio_priv(indio_dev);
return ad7291_i2c_write(chip, AD7291_COMMAND, return ad7291_i2c_write(chip, AD7291_COMMAND,
chip->command | AD7291_RESET); chip->command | AD7291_RESET);
...@@ -213,8 +213,8 @@ static inline ssize_t ad7291_show_hyst(struct device *dev, ...@@ -213,8 +213,8 @@ static inline ssize_t ad7291_show_hyst(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 ad7291_chip_info *chip = iio_priv(dev_info); struct ad7291_chip_info *chip = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
u16 data; u16 data;
int ret; int ret;
...@@ -231,8 +231,8 @@ static inline ssize_t ad7291_set_hyst(struct device *dev, ...@@ -231,8 +231,8 @@ static inline ssize_t ad7291_set_hyst(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7291_chip_info *chip = iio_priv(dev_info); struct ad7291_chip_info *chip = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
u16 data; u16 data;
int ret; int ret;
......
...@@ -109,24 +109,24 @@ static int ad7298_scan_temp(struct ad7298_state *st, int *val) ...@@ -109,24 +109,24 @@ static int ad7298_scan_temp(struct ad7298_state *st, int *val)
return 0; return 0;
} }
static int ad7298_read_raw(struct iio_dev *dev_info, static int ad7298_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, struct iio_chan_spec const *chan,
int *val, int *val,
int *val2, int *val2,
long m) long m)
{ {
int ret; int ret;
struct ad7298_state *st = iio_priv(dev_info); struct ad7298_state *st = iio_priv(indio_dev);
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case 0:
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(dev_info)) { if (iio_buffer_enabled(indio_dev)) {
if (chan->address == AD7298_CH_TEMP) if (chan->address == AD7298_CH_TEMP)
ret = -ENODEV; ret = -ENODEV;
else else
ret = ad7298_scan_from_ring(dev_info, ret = ad7298_scan_from_ring(indio_dev,
chan->address); chan->address);
} else { } else {
if (chan->address == AD7298_CH_TEMP) if (chan->address == AD7298_CH_TEMP)
...@@ -134,7 +134,7 @@ static int ad7298_read_raw(struct iio_dev *dev_info, ...@@ -134,7 +134,7 @@ static int ad7298_read_raw(struct iio_dev *dev_info,
else else
ret = ad7298_scan_direct(st, chan->address); ret = ad7298_scan_direct(st, chan->address);
} }
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#include "ad7298.h" #include "ad7298.h"
int ad7298_scan_from_ring(struct iio_dev *dev_info, long ch) int ad7298_scan_from_ring(struct iio_dev *indio_dev, long ch)
{ {
struct iio_buffer *ring = dev_info->buffer; struct iio_buffer *ring = indio_dev->buffer;
int ret; int ret;
u16 *ring_data; u16 *ring_data;
......
...@@ -32,24 +32,24 @@ static int ad7476_scan_direct(struct ad7476_state *st) ...@@ -32,24 +32,24 @@ static int ad7476_scan_direct(struct ad7476_state *st)
return (st->data[0] << 8) | st->data[1]; return (st->data[0] << 8) | st->data[1];
} }
static int ad7476_read_raw(struct iio_dev *dev_info, static int ad7476_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, struct iio_chan_spec const *chan,
int *val, int *val,
int *val2, int *val2,
long m) long m)
{ {
int ret; int ret;
struct ad7476_state *st = iio_priv(dev_info); struct ad7476_state *st = iio_priv(indio_dev);
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case 0:
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(dev_info)) if (iio_buffer_enabled(indio_dev))
ret = ad7476_scan_from_ring(dev_info); ret = ad7476_scan_from_ring(indio_dev);
else else
ret = ad7476_scan_direct(st); ret = ad7476_scan_direct(st);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -112,8 +112,8 @@ static ssize_t ad7816_show_mode(struct device *dev, ...@@ -112,8 +112,8 @@ static ssize_t ad7816_show_mode(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 ad7816_chip_info *chip = iio_priv(dev_info); struct ad7816_chip_info *chip = iio_priv(indio_dev);
if (chip->mode) if (chip->mode)
return sprintf(buf, "power-save\n"); return sprintf(buf, "power-save\n");
...@@ -126,8 +126,8 @@ static ssize_t ad7816_store_mode(struct device *dev, ...@@ -126,8 +126,8 @@ static ssize_t ad7816_store_mode(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7816_chip_info *chip = iio_priv(dev_info); struct ad7816_chip_info *chip = iio_priv(indio_dev);
if (strcmp(buf, "full")) { if (strcmp(buf, "full")) {
gpio_set_value(chip->rdwr_pin, 1); gpio_set_value(chip->rdwr_pin, 1);
...@@ -158,8 +158,8 @@ static ssize_t ad7816_show_channel(struct device *dev, ...@@ -158,8 +158,8 @@ static ssize_t ad7816_show_channel(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 ad7816_chip_info *chip = iio_priv(dev_info); struct ad7816_chip_info *chip = iio_priv(indio_dev);
return sprintf(buf, "%d\n", chip->channel_id); return sprintf(buf, "%d\n", chip->channel_id);
} }
...@@ -169,8 +169,8 @@ static ssize_t ad7816_store_channel(struct device *dev, ...@@ -169,8 +169,8 @@ static ssize_t ad7816_store_channel(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7816_chip_info *chip = iio_priv(dev_info); struct ad7816_chip_info *chip = iio_priv(indio_dev);
unsigned long data; unsigned long data;
int ret; int ret;
...@@ -180,13 +180,13 @@ static ssize_t ad7816_store_channel(struct device *dev, ...@@ -180,13 +180,13 @@ static ssize_t ad7816_store_channel(struct device *dev,
if (data > AD7816_CS_MAX && data != AD7816_CS_MASK) { if (data > AD7816_CS_MAX && data != AD7816_CS_MASK) {
dev_err(&chip->spi_dev->dev, "Invalid channel id %lu for %s.\n", dev_err(&chip->spi_dev->dev, "Invalid channel id %lu for %s.\n",
data, dev_info->name); data, indio_dev->name);
return -EINVAL; return -EINVAL;
} else if (strcmp(dev_info->name, "ad7818") == 0 && data > 1) { } else if (strcmp(indio_dev->name, "ad7818") == 0 && data > 1) {
dev_err(&chip->spi_dev->dev, dev_err(&chip->spi_dev->dev,
"Invalid channel id %lu for ad7818.\n", data); "Invalid channel id %lu for ad7818.\n", data);
return -EINVAL; return -EINVAL;
} else if (strcmp(dev_info->name, "ad7816") == 0 && data > 0) { } else if (strcmp(indio_dev->name, "ad7816") == 0 && data > 0) {
dev_err(&chip->spi_dev->dev, dev_err(&chip->spi_dev->dev,
"Invalid channel id %lu for ad7816.\n", data); "Invalid channel id %lu for ad7816.\n", data);
return -EINVAL; return -EINVAL;
...@@ -207,8 +207,8 @@ static ssize_t ad7816_show_value(struct device *dev, ...@@ -207,8 +207,8 @@ static ssize_t ad7816_show_value(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 ad7816_chip_info *chip = iio_priv(dev_info); struct ad7816_chip_info *chip = iio_priv(indio_dev);
u16 data; u16 data;
s8 value; s8 value;
int ret; int ret;
...@@ -262,8 +262,8 @@ static ssize_t ad7816_show_oti(struct device *dev, ...@@ -262,8 +262,8 @@ static ssize_t ad7816_show_oti(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 ad7816_chip_info *chip = iio_priv(dev_info); struct ad7816_chip_info *chip = iio_priv(indio_dev);
int value; int value;
if (chip->channel_id > AD7816_CS_MAX) { if (chip->channel_id > AD7816_CS_MAX) {
...@@ -283,8 +283,8 @@ static inline ssize_t ad7816_set_oti(struct device *dev, ...@@ -283,8 +283,8 @@ static inline ssize_t ad7816_set_oti(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad7816_chip_info *chip = iio_priv(dev_info); struct ad7816_chip_info *chip = iio_priv(indio_dev);
long value; long value;
u8 data; u8 data;
int ret; int ret;
......
...@@ -31,24 +31,24 @@ static int ad7887_scan_direct(struct ad7887_state *st, unsigned ch) ...@@ -31,24 +31,24 @@ static int ad7887_scan_direct(struct ad7887_state *st, unsigned ch)
return (st->data[(ch * 2)] << 8) | st->data[(ch * 2) + 1]; return (st->data[(ch * 2)] << 8) | st->data[(ch * 2) + 1];
} }
static int ad7887_read_raw(struct iio_dev *dev_info, static int ad7887_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, struct iio_chan_spec const *chan,
int *val, int *val,
int *val2, int *val2,
long m) long m)
{ {
int ret; int ret;
struct ad7887_state *st = iio_priv(dev_info); struct ad7887_state *st = iio_priv(indio_dev);
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case 0:
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(dev_info)) if (iio_buffer_enabled(indio_dev))
ret = ad7887_scan_from_ring(st, 1 << chan->address); ret = ad7887_scan_from_ring(st, 1 << chan->address);
else else
ret = ad7887_scan_direct(st, chan->address); ret = ad7887_scan_direct(st, chan->address);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -136,25 +136,25 @@ static int ad799x_scan_direct(struct ad799x_state *st, unsigned ch) ...@@ -136,25 +136,25 @@ static int ad799x_scan_direct(struct ad799x_state *st, unsigned ch)
return rxbuf; return rxbuf;
} }
static int ad799x_read_raw(struct iio_dev *dev_info, static int ad799x_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, struct iio_chan_spec const *chan,
int *val, int *val,
int *val2, int *val2,
long m) long m)
{ {
int ret; int ret;
struct ad799x_state *st = iio_priv(dev_info); struct ad799x_state *st = iio_priv(indio_dev);
unsigned int scale_uv; unsigned int scale_uv;
switch (m) { switch (m) {
case 0: case 0:
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
if (iio_buffer_enabled(dev_info)) if (iio_buffer_enabled(indio_dev))
ret = ad799x_single_channel_from_ring(dev_info, ret = ad799x_single_channel_from_ring(indio_dev,
chan->scan_index); chan->scan_index);
else else
ret = ad799x_scan_direct(st, chan->scan_index); ret = ad799x_scan_direct(st, chan->scan_index);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -182,8 +182,8 @@ static ssize_t ad799x_read_frequency(struct device *dev, ...@@ -182,8 +182,8 @@ static ssize_t ad799x_read_frequency(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 ad799x_state *st = iio_priv(dev_info); struct ad799x_state *st = iio_priv(indio_dev);
int ret; int ret;
u8 val; u8 val;
...@@ -201,8 +201,8 @@ static ssize_t ad799x_write_frequency(struct device *dev, ...@@ -201,8 +201,8 @@ static ssize_t ad799x_write_frequency(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad799x_state *st = iio_priv(dev_info); struct ad799x_state *st = iio_priv(indio_dev);
long val; long val;
int ret, i; int ret, i;
...@@ -212,7 +212,7 @@ static ssize_t ad799x_write_frequency(struct device *dev, ...@@ -212,7 +212,7 @@ static ssize_t ad799x_write_frequency(struct device *dev,
if (ret) if (ret)
return ret; return ret;
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
ret = ad799x_i2c_read8(st, AD7998_CYCLE_TMR_REG, &t); ret = ad799x_i2c_read8(st, AD7998_CYCLE_TMR_REG, &t);
if (ret) if (ret)
goto error_ret_mutex; goto error_ret_mutex;
...@@ -230,12 +230,12 @@ static ssize_t ad799x_write_frequency(struct device *dev, ...@@ -230,12 +230,12 @@ static ssize_t ad799x_write_frequency(struct device *dev,
ret = ad799x_i2c_write8(st, AD7998_CYCLE_TMR_REG, t); ret = ad799x_i2c_write8(st, AD7998_CYCLE_TMR_REG, t);
error_ret_mutex: error_ret_mutex:
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
return ret ? ret : len; return ret ? ret : len;
} }
static int ad799x_read_event_config(struct iio_dev *dev_info, static int ad799x_read_event_config(struct iio_dev *indio_dev,
u64 event_code) u64 event_code)
{ {
return 1; return 1;
...@@ -294,8 +294,8 @@ static ssize_t ad799x_read_channel_config(struct device *dev, ...@@ -294,8 +294,8 @@ static ssize_t ad799x_read_channel_config(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 ad799x_state *st = iio_priv(dev_info); struct ad799x_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
int ret; int ret;
...@@ -312,8 +312,8 @@ static ssize_t ad799x_write_channel_config(struct device *dev, ...@@ -312,8 +312,8 @@ static ssize_t ad799x_write_channel_config(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *dev_info = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ad799x_state *st = iio_priv(dev_info); struct ad799x_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
long val; long val;
...@@ -323,9 +323,9 @@ static ssize_t ad799x_write_channel_config(struct device *dev, ...@@ -323,9 +323,9 @@ static ssize_t ad799x_write_channel_config(struct device *dev,
if (ret) if (ret)
return ret; return ret;
mutex_lock(&dev_info->mlock); mutex_lock(&indio_dev->mlock);
ret = ad799x_i2c_write16(st, this_attr->address, val); ret = ad799x_i2c_write16(st, this_attr->address, val);
mutex_unlock(&dev_info->mlock); mutex_unlock(&indio_dev->mlock);
return ret ? ret : len; return ret ? ret : len;
} }
......
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