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
...@@ -58,8 +58,7 @@ static int ad5624r_spi_write(struct spi_device *spi, ...@@ -58,8 +58,7 @@ 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;
...@@ -77,8 +76,7 @@ static ssize_t ad5624r_write_dac(struct device *dev, ...@@ -77,8 +76,7 @@ static ssize_t ad5624r_write_dac(struct device *dev,
} }
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;
...@@ -88,8 +86,7 @@ static ssize_t ad5624r_read_ldac_mode(struct device *dev, ...@@ -88,8 +86,7 @@ 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,7 +97,8 @@ static ssize_t ad5624r_write_ldac_mode(struct device *dev, ...@@ -100,7 +97,8 @@ 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;
...@@ -119,8 +117,7 @@ static ssize_t ad5624r_read_dac_power_mode(struct device *dev, ...@@ -119,8 +117,7 @@ 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;
...@@ -152,8 +150,7 @@ static ssize_t ad5624r_read_internal_ref_mode(struct device *dev, ...@@ -152,8 +150,7 @@ 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;
...@@ -178,16 +176,21 @@ static IIO_DEV_ATTR_OUT_RAW(3, ad5624r_write_dac, AD5624R_ADDR_DAC3); ...@@ -178,16 +176,21 @@ 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_read_internal_ref_mode,
ad5624r_write_internal_ref_mode, 0); 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,
......
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