Commit 0eea4ce3 authored by Sandhya Bankar's avatar Sandhya Bankar Committed by Greg Kroah-Hartman

Staging: iio: ade7758_core: Fix open parentheses alignment issues.

Fix open parentheses alignment issues.
Signed-off-by: default avatarSandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5359ada2
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
#include "meter.h" #include "meter.h"
#include "ade7758.h" #include "ade7758.h"
int ade7758_spi_write_reg_8(struct device *dev, int ade7758_spi_write_reg_8(struct device *dev, u8 reg_address, u8 val)
u8 reg_address,
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);
...@@ -42,9 +40,8 @@ int ade7758_spi_write_reg_8(struct device *dev, ...@@ -42,9 +40,8 @@ int ade7758_spi_write_reg_8(struct device *dev,
return ret; return ret;
} }
static int ade7758_spi_write_reg_16(struct device *dev, static int ade7758_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);
...@@ -68,9 +65,8 @@ static int ade7758_spi_write_reg_16(struct device *dev, ...@@ -68,9 +65,8 @@ static int ade7758_spi_write_reg_16(struct device *dev,
return ret; return ret;
} }
static int ade7758_spi_write_reg_24(struct device *dev, static int ade7758_spi_write_reg_24(struct device *dev, u8 reg_address,
u8 reg_address, u32 value)
u32 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);
...@@ -95,9 +91,7 @@ static int ade7758_spi_write_reg_24(struct device *dev, ...@@ -95,9 +91,7 @@ static int ade7758_spi_write_reg_24(struct device *dev,
return ret; return ret;
} }
int ade7758_spi_read_reg_8(struct device *dev, int ade7758_spi_read_reg_8(struct device *dev, u8 reg_address, u8 *val)
u8 reg_address,
u8 *val)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7758_state *st = iio_priv(indio_dev); struct ade7758_state *st = iio_priv(indio_dev);
...@@ -124,7 +118,7 @@ int ade7758_spi_read_reg_8(struct device *dev, ...@@ -124,7 +118,7 @@ int ade7758_spi_read_reg_8(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 8 bit register 0x%02X", dev_err(&st->us->dev, "problem when reading 8 bit register 0x%02X",
reg_address); reg_address);
goto error_ret; goto error_ret;
} }
*val = st->rx[0]; *val = st->rx[0];
...@@ -134,9 +128,8 @@ int ade7758_spi_read_reg_8(struct device *dev, ...@@ -134,9 +128,8 @@ int ade7758_spi_read_reg_8(struct device *dev,
return ret; return ret;
} }
static int ade7758_spi_read_reg_16(struct device *dev, static int ade7758_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 ade7758_state *st = iio_priv(indio_dev); struct ade7758_state *st = iio_priv(indio_dev);
...@@ -165,7 +158,7 @@ static int ade7758_spi_read_reg_16(struct device *dev, ...@@ -165,7 +158,7 @@ static int ade7758_spi_read_reg_16(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 16 bit register 0x%02X", dev_err(&st->us->dev, "problem when reading 16 bit register 0x%02X",
reg_address); reg_address);
goto error_ret; goto error_ret;
} }
...@@ -176,9 +169,8 @@ static int ade7758_spi_read_reg_16(struct device *dev, ...@@ -176,9 +169,8 @@ static int ade7758_spi_read_reg_16(struct device *dev,
return ret; return ret;
} }
static int ade7758_spi_read_reg_24(struct device *dev, static int ade7758_spi_read_reg_24(struct device *dev, u8 reg_address,
u8 reg_address, u32 *val)
u32 *val)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ade7758_state *st = iio_priv(indio_dev); struct ade7758_state *st = iio_priv(indio_dev);
...@@ -207,7 +199,7 @@ static int ade7758_spi_read_reg_24(struct device *dev, ...@@ -207,7 +199,7 @@ static int ade7758_spi_read_reg_24(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 24 bit register 0x%02X", dev_err(&st->us->dev, "problem when reading 24 bit register 0x%02X",
reg_address); reg_address);
goto error_ret; goto error_ret;
} }
*val = (st->rx[0] << 16) | (st->rx[1] << 8) | st->rx[2]; *val = (st->rx[0] << 16) | (st->rx[1] << 8) | st->rx[2];
...@@ -218,8 +210,7 @@ static int ade7758_spi_read_reg_24(struct device *dev, ...@@ -218,8 +210,7 @@ static int ade7758_spi_read_reg_24(struct device *dev,
} }
static ssize_t ade7758_read_8bit(struct device *dev, static ssize_t ade7758_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;
...@@ -233,8 +224,7 @@ static ssize_t ade7758_read_8bit(struct device *dev, ...@@ -233,8 +224,7 @@ static ssize_t ade7758_read_8bit(struct device *dev,
} }
static ssize_t ade7758_read_16bit(struct device *dev, static ssize_t ade7758_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;
...@@ -248,8 +238,7 @@ static ssize_t ade7758_read_16bit(struct device *dev, ...@@ -248,8 +238,7 @@ static ssize_t ade7758_read_16bit(struct device *dev,
} }
static ssize_t ade7758_read_24bit(struct device *dev, static ssize_t ade7758_read_24bit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr, char *buf)
char *buf)
{ {
int ret; int ret;
u32 val = 0; u32 val = 0;
...@@ -263,9 +252,8 @@ static ssize_t ade7758_read_24bit(struct device *dev, ...@@ -263,9 +252,8 @@ static ssize_t ade7758_read_24bit(struct device *dev,
} }
static ssize_t ade7758_write_8bit(struct device *dev, static ssize_t ade7758_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;
...@@ -281,9 +269,8 @@ static ssize_t ade7758_write_8bit(struct device *dev, ...@@ -281,9 +269,8 @@ static ssize_t ade7758_write_8bit(struct device *dev,
} }
static ssize_t ade7758_write_16bit(struct device *dev, static ssize_t ade7758_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;
...@@ -479,16 +466,13 @@ static int ade7758_initial_setup(struct iio_dev *indio_dev) ...@@ -479,16 +466,13 @@ static int ade7758_initial_setup(struct iio_dev *indio_dev)
} }
static ssize_t ade7758_read_frequency(struct device *dev, static ssize_t ade7758_read_frequency(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr, char *buf)
char *buf)
{ {
int ret; int ret;
u8 t; u8 t;
int sps; int sps;
ret = ade7758_spi_read_reg_8(dev, ret = ade7758_spi_read_reg_8(dev, ADE7758_WAVMODE, &t);
ADE7758_WAVMODE,
&t);
if (ret) if (ret)
return ret; return ret;
...@@ -499,9 +483,8 @@ static ssize_t ade7758_read_frequency(struct device *dev, ...@@ -499,9 +483,8 @@ static ssize_t ade7758_read_frequency(struct device *dev,
} }
static ssize_t ade7758_write_frequency(struct device *dev, static ssize_t ade7758_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);
u16 val; u16 val;
...@@ -532,18 +515,14 @@ static ssize_t ade7758_write_frequency(struct device *dev, ...@@ -532,18 +515,14 @@ static ssize_t ade7758_write_frequency(struct device *dev,
goto out; goto out;
} }
ret = ade7758_spi_read_reg_8(dev, ret = ade7758_spi_read_reg_8(dev, ADE7758_WAVMODE, &reg);
ADE7758_WAVMODE,
&reg);
if (ret) if (ret)
goto out; goto out;
reg &= ~(5 << 3); reg &= ~(5 << 3);
reg |= t << 5; reg |= t << 5;
ret = ade7758_spi_write_reg_8(dev, ret = ade7758_spi_write_reg_8(dev, ADE7758_WAVMODE, reg);
ADE7758_WAVMODE,
reg);
out: out:
mutex_unlock(&indio_dev->mlock); mutex_unlock(&indio_dev->mlock);
......
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