Commit 24d6050b authored by Michael Hennerich's avatar Michael Hennerich Committed by Greg Kroah-Hartman

staging: iio: dac: Cleanup style - no functional changes

Stick to the 80 character line limit at least for code
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 ece30c15
...@@ -57,9 +57,8 @@ static int ad5624r_spi_write(struct spi_device *spi, ...@@ -57,9 +57,8 @@ static int ad5624r_spi_write(struct spi_device *spi,
} }
static ssize_t ad5624r_write_dac(struct device *dev, static ssize_t ad5624r_write_dac(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf, size_t len)
size_t len)
{ {
long readin; long readin;
int ret; int ret;
...@@ -72,13 +71,12 @@ static ssize_t ad5624r_write_dac(struct device *dev, ...@@ -72,13 +71,12 @@ static ssize_t ad5624r_write_dac(struct device *dev,
return ret; return ret;
ret = ad5624r_spi_write(st->us, AD5624R_CMD_WRITE_INPUT_N_UPDATE_N, ret = ad5624r_spi_write(st->us, AD5624R_CMD_WRITE_INPUT_N_UPDATE_N,
this_attr->address, readin, st->data_len); this_attr->address, readin, st->data_len);
return ret ? ret : len; return ret ? ret : len;
} }
static ssize_t ad5624r_read_ldac_mode(struct device *dev, static ssize_t ad5624r_read_ldac_mode(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr, 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 = indio_dev->dev_data;
...@@ -87,9 +85,8 @@ static ssize_t ad5624r_read_ldac_mode(struct device *dev, ...@@ -87,9 +85,8 @@ static ssize_t ad5624r_read_ldac_mode(struct device *dev,
} }
static ssize_t ad5624r_write_ldac_mode(struct device *dev, static ssize_t ad5624r_write_ldac_mode(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf, size_t len)
size_t len)
{ {
long readin; long readin;
int ret; int ret;
...@@ -100,15 +97,16 @@ static ssize_t ad5624r_write_ldac_mode(struct device *dev, ...@@ -100,15 +97,16 @@ static ssize_t ad5624r_write_ldac_mode(struct device *dev,
if (ret) if (ret)
return ret; return ret;
ret = ad5624r_spi_write(st->us, AD5624R_CMD_LDAC_SETUP, 0, readin & 0xF, 16); ret = ad5624r_spi_write(st->us, AD5624R_CMD_LDAC_SETUP, 0,
readin & 0xF, 16);
st->ldac_mode = readin & 0xF; st->ldac_mode = readin & 0xF;
return ret ? ret : len; return ret ? ret : len;
} }
static ssize_t ad5624r_read_dac_power_mode(struct device *dev, static ssize_t ad5624r_read_dac_power_mode(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
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 = indio_dev->dev_data;
...@@ -118,9 +116,8 @@ static ssize_t ad5624r_read_dac_power_mode(struct device *dev, ...@@ -118,9 +116,8 @@ static ssize_t ad5624r_read_dac_power_mode(struct device *dev,
} }
static ssize_t ad5624r_write_dac_power_mode(struct device *dev, static ssize_t ad5624r_write_dac_power_mode(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf, size_t len)
size_t len)
{ {
long readin; long readin;
int ret; int ret;
...@@ -133,7 +130,8 @@ static ssize_t ad5624r_write_dac_power_mode(struct device *dev, ...@@ -133,7 +130,8 @@ static ssize_t ad5624r_write_dac_power_mode(struct device *dev,
return ret; return ret;
ret = ad5624r_spi_write(st->us, AD5624R_CMD_POWERDOWN_DAC, 0, ret = ad5624r_spi_write(st->us, AD5624R_CMD_POWERDOWN_DAC, 0,
((readin & 0x3) << 4) | (1 << this_attr->address), 16); ((readin & 0x3) << 4) |
(1 << this_attr->address), 16);
st->dac_power_mode[this_attr->address] = readin & 0x3; st->dac_power_mode[this_attr->address] = readin & 0x3;
...@@ -141,8 +139,8 @@ static ssize_t ad5624r_write_dac_power_mode(struct device *dev, ...@@ -141,8 +139,8 @@ static ssize_t ad5624r_write_dac_power_mode(struct device *dev,
} }
static ssize_t ad5624r_read_internal_ref_mode(struct device *dev, static ssize_t ad5624r_read_internal_ref_mode(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
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 = indio_dev->dev_data;
...@@ -151,9 +149,8 @@ static ssize_t ad5624r_read_internal_ref_mode(struct device *dev, ...@@ -151,9 +149,8 @@ static ssize_t ad5624r_read_internal_ref_mode(struct device *dev,
} }
static ssize_t ad5624r_write_internal_ref_mode(struct device *dev, static ssize_t ad5624r_write_internal_ref_mode(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf, size_t len)
size_t len)
{ {
long readin; long readin;
int ret; int ret;
...@@ -164,7 +161,8 @@ static ssize_t ad5624r_write_internal_ref_mode(struct device *dev, ...@@ -164,7 +161,8 @@ static ssize_t ad5624r_write_internal_ref_mode(struct device *dev,
if (ret) if (ret)
return ret; return ret;
ret = ad5624r_spi_write(st->us, AD5624R_CMD_INTERNAL_REFER_SETUP, 0, !!readin, 16); ret = ad5624r_spi_write(st->us, AD5624R_CMD_INTERNAL_REFER_SETUP, 0,
!!readin, 16);
st->internal_ref = !!readin; st->internal_ref = !!readin;
...@@ -177,17 +175,22 @@ static IIO_DEV_ATTR_OUT_RAW(2, ad5624r_write_dac, AD5624R_ADDR_DAC2); ...@@ -177,17 +175,22 @@ static IIO_DEV_ATTR_OUT_RAW(2, ad5624r_write_dac, AD5624R_ADDR_DAC2);
static IIO_DEV_ATTR_OUT_RAW(3, ad5624r_write_dac, AD5624R_ADDR_DAC3); static IIO_DEV_ATTR_OUT_RAW(3, ad5624r_write_dac, AD5624R_ADDR_DAC3);
static IIO_DEVICE_ATTR(ldac_mode, S_IRUGO | S_IWUSR, ad5624r_read_ldac_mode, static IIO_DEVICE_ATTR(ldac_mode, S_IRUGO | S_IWUSR, ad5624r_read_ldac_mode,
ad5624r_write_ldac_mode, 0); ad5624r_write_ldac_mode, 0);
static IIO_DEVICE_ATTR(internal_ref, S_IRUGO | S_IWUSR, ad5624r_read_internal_ref_mode, static IIO_DEVICE_ATTR(internal_ref, S_IRUGO | S_IWUSR,
ad5624r_write_internal_ref_mode, 0); ad5624r_read_internal_ref_mode,
ad5624r_write_internal_ref_mode, 0);
#define IIO_DEV_ATTR_DAC_POWER_MODE(_num, _show, _store, _addr) \ #define IIO_DEV_ATTR_DAC_POWER_MODE(_num, _show, _store, _addr) \
IIO_DEVICE_ATTR(dac_power_mode_##_num, S_IRUGO | S_IWUSR, _show, _store, _addr) IIO_DEVICE_ATTR(dac_power_mode_##_num, S_IRUGO | S_IWUSR, _show, _store, _addr)
static IIO_DEV_ATTR_DAC_POWER_MODE(0, ad5624r_read_dac_power_mode, ad5624r_write_dac_power_mode, 0); static IIO_DEV_ATTR_DAC_POWER_MODE(0, ad5624r_read_dac_power_mode,
static IIO_DEV_ATTR_DAC_POWER_MODE(1, ad5624r_read_dac_power_mode, ad5624r_write_dac_power_mode, 1); ad5624r_write_dac_power_mode, 0);
static IIO_DEV_ATTR_DAC_POWER_MODE(2, ad5624r_read_dac_power_mode, ad5624r_write_dac_power_mode, 2); static IIO_DEV_ATTR_DAC_POWER_MODE(1, ad5624r_read_dac_power_mode,
static IIO_DEV_ATTR_DAC_POWER_MODE(3, ad5624r_read_dac_power_mode, ad5624r_write_dac_power_mode, 3); ad5624r_write_dac_power_mode, 1);
static IIO_DEV_ATTR_DAC_POWER_MODE(2, ad5624r_read_dac_power_mode,
ad5624r_write_dac_power_mode, 2);
static IIO_DEV_ATTR_DAC_POWER_MODE(3, ad5624r_read_dac_power_mode,
ad5624r_write_dac_power_mode, 3);
static struct attribute *ad5624r_attributes[] = { static struct attribute *ad5624r_attributes[] = {
&iio_dev_attr_out0_raw.dev_attr.attr, &iio_dev_attr_out0_raw.dev_attr.attr,
...@@ -272,9 +275,9 @@ static const struct spi_device_id ad5624r_id[] = { ...@@ -272,9 +275,9 @@ static const struct spi_device_id ad5624r_id[] = {
static struct spi_driver ad5624r_driver = { static struct spi_driver ad5624r_driver = {
.driver = { .driver = {
.name = "ad5624r", .name = "ad5624r",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = ad5624r_probe, .probe = ad5624r_probe,
.remove = __devexit_p(ad5624r_remove), .remove = __devexit_p(ad5624r_remove),
.id_table = ad5624r_id, .id_table = ad5624r_id,
......
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