Commit 7fe2241c authored by rodrigosiqueira's avatar rodrigosiqueira Committed by Jonathan Cameron

staging: ade7759: Fix open parenthesis alignment

This patch fixes the CHECKs reported by checkpatch.pl for "alignment
should match open parenthesis"
Signed-off-by: default avatarrodrigosiqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 79e8a32d
...@@ -72,8 +72,8 @@ struct ade7759_state { ...@@ -72,8 +72,8 @@ struct ade7759_state {
}; };
static int ade7759_spi_write_reg_8(struct device *dev, static int ade7759_spi_write_reg_8(struct device *dev,
u8 reg_address, u8 reg_address,
u8 val) u8 val)
{ {
int ret; int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
...@@ -91,8 +91,8 @@ static int ade7759_spi_write_reg_8(struct device *dev, ...@@ -91,8 +91,8 @@ static int ade7759_spi_write_reg_8(struct device *dev,
/*Unlocked version of ade7759_spi_write_reg_16 function */ /*Unlocked version of ade7759_spi_write_reg_16 function */
static int __ade7759_spi_write_reg_16(struct device *dev, static int __ade7759_spi_write_reg_16(struct device *dev,
u8 reg_address, u8 reg_address,
u16 value) u16 value)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7759_state *st = iio_priv(indio_dev); struct ade7759_state *st = iio_priv(indio_dev);
...@@ -104,8 +104,8 @@ static int __ade7759_spi_write_reg_16(struct device *dev, ...@@ -104,8 +104,8 @@ static int __ade7759_spi_write_reg_16(struct device *dev,
} }
static int ade7759_spi_write_reg_16(struct device *dev, static int ade7759_spi_write_reg_16(struct device *dev,
u8 reg_address, u8 reg_address,
u16 value) u16 value)
{ {
int ret; int ret;
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
...@@ -119,8 +119,8 @@ static int ade7759_spi_write_reg_16(struct device *dev, ...@@ -119,8 +119,8 @@ static int ade7759_spi_write_reg_16(struct device *dev,
} }
static int ade7759_spi_read_reg_8(struct device *dev, static int ade7759_spi_read_reg_8(struct device *dev,
u8 reg_address, u8 reg_address,
u8 *val) u8 *val)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7759_state *st = iio_priv(indio_dev); struct ade7759_state *st = iio_priv(indio_dev);
...@@ -128,8 +128,9 @@ static int ade7759_spi_read_reg_8(struct device *dev, ...@@ -128,8 +128,9 @@ static int ade7759_spi_read_reg_8(struct device *dev,
ret = spi_w8r8(st->us, ADE7759_READ_REG(reg_address)); ret = spi_w8r8(st->us, ADE7759_READ_REG(reg_address));
if (ret < 0) { if (ret < 0) {
dev_err(&st->us->dev, "problem when reading 8 bit register 0x%02X", dev_err(&st->us->dev,
reg_address); "problem when reading 8 bit register 0x%02X",
reg_address);
return ret; return ret;
} }
*val = ret; *val = ret;
...@@ -138,8 +139,8 @@ static int ade7759_spi_read_reg_8(struct device *dev, ...@@ -138,8 +139,8 @@ static int ade7759_spi_read_reg_8(struct device *dev,
} }
static int ade7759_spi_read_reg_16(struct device *dev, static int ade7759_spi_read_reg_16(struct device *dev,
u8 reg_address, u8 reg_address,
u16 *val) u16 *val)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7759_state *st = iio_priv(indio_dev); struct ade7759_state *st = iio_priv(indio_dev);
...@@ -158,8 +159,8 @@ static int ade7759_spi_read_reg_16(struct device *dev, ...@@ -158,8 +159,8 @@ static int ade7759_spi_read_reg_16(struct device *dev,
} }
static int ade7759_spi_read_reg_40(struct device *dev, static int ade7759_spi_read_reg_40(struct device *dev,
u8 reg_address, u8 reg_address,
u64 *val) u64 *val)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7759_state *st = iio_priv(indio_dev); struct ade7759_state *st = iio_priv(indio_dev);
...@@ -179,8 +180,9 @@ static int ade7759_spi_read_reg_40(struct device *dev, ...@@ -179,8 +180,9 @@ static int ade7759_spi_read_reg_40(struct device *dev,
ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers)); ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers));
if (ret) { if (ret) {
dev_err(&st->us->dev, "problem when reading 40 bit register 0x%02X", dev_err(&st->us->dev,
reg_address); "problem when reading 40 bit register 0x%02X",
reg_address);
goto error_ret; goto error_ret;
} }
*val = ((u64)st->rx[1] << 32) | ((u64)st->rx[2] << 24) | *val = ((u64)st->rx[1] << 32) | ((u64)st->rx[2] << 24) |
...@@ -192,8 +194,8 @@ static int ade7759_spi_read_reg_40(struct device *dev, ...@@ -192,8 +194,8 @@ static int ade7759_spi_read_reg_40(struct device *dev,
} }
static ssize_t ade7759_read_8bit(struct device *dev, static ssize_t ade7759_read_8bit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
int ret; int ret;
u8 val = 0; u8 val = 0;
...@@ -207,8 +209,8 @@ static ssize_t ade7759_read_8bit(struct device *dev, ...@@ -207,8 +209,8 @@ static ssize_t ade7759_read_8bit(struct device *dev,
} }
static ssize_t ade7759_read_16bit(struct device *dev, static ssize_t ade7759_read_16bit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
int ret; int ret;
u16 val = 0; u16 val = 0;
...@@ -222,8 +224,8 @@ static ssize_t ade7759_read_16bit(struct device *dev, ...@@ -222,8 +224,8 @@ static ssize_t ade7759_read_16bit(struct device *dev,
} }
static ssize_t ade7759_read_40bit(struct device *dev, static ssize_t ade7759_read_40bit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
int ret; int ret;
u64 val = 0; u64 val = 0;
...@@ -237,9 +239,9 @@ static ssize_t ade7759_read_40bit(struct device *dev, ...@@ -237,9 +239,9 @@ static ssize_t ade7759_read_40bit(struct device *dev,
} }
static ssize_t ade7759_write_8bit(struct device *dev, static ssize_t ade7759_write_8bit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
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;
...@@ -255,9 +257,9 @@ static ssize_t ade7759_write_8bit(struct device *dev, ...@@ -255,9 +257,9 @@ static ssize_t ade7759_write_8bit(struct device *dev,
} }
static ssize_t ade7759_write_16bit(struct device *dev, static ssize_t ade7759_write_16bit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
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;
...@@ -277,9 +279,7 @@ static int ade7759_reset(struct device *dev) ...@@ -277,9 +279,7 @@ static int ade7759_reset(struct device *dev)
int ret; int ret;
u16 val; u16 val;
ret = ade7759_spi_read_reg_16(dev, ret = ade7759_spi_read_reg_16(dev, ADE7759_MODE, &val);
ADE7759_MODE,
&val);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -365,9 +365,7 @@ static int ade7759_stop_device(struct device *dev) ...@@ -365,9 +365,7 @@ static int ade7759_stop_device(struct device *dev)
int ret; int ret;
u16 val; u16 val;
ret = ade7759_spi_read_reg_16(dev, ret = ade7759_spi_read_reg_16(dev, ADE7759_MODE, &val);
ADE7759_MODE,
&val);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "unable to power down the device, error: %d\n", dev_err(dev, "unable to power down the device, error: %d\n",
ret); ret);
...@@ -404,16 +402,14 @@ static int ade7759_initial_setup(struct iio_dev *indio_dev) ...@@ -404,16 +402,14 @@ static int ade7759_initial_setup(struct iio_dev *indio_dev)
} }
static ssize_t ade7759_read_frequency(struct device *dev, static ssize_t ade7759_read_frequency(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
int ret; int ret;
u16 t; u16 t;
int sps; int sps;
ret = ade7759_spi_read_reg_16(dev, ret = ade7759_spi_read_reg_16(dev, ADE7759_MODE, &t);
ADE7759_MODE,
&t);
if (ret) if (ret)
return ret; return ret;
...@@ -424,9 +420,9 @@ static ssize_t ade7759_read_frequency(struct device *dev, ...@@ -424,9 +420,9 @@ static ssize_t ade7759_read_frequency(struct device *dev,
} }
static ssize_t ade7759_write_frequency(struct device *dev, static ssize_t ade7759_write_frequency(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7759_state *st = iio_priv(indio_dev); struct ade7759_state *st = iio_priv(indio_dev);
......
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