Commit 1533e457 authored by Hardik Singh Rathore's avatar Hardik Singh Rathore Committed by Jonathan Cameron

staging: iio: adt7316: drop unnecessary initialization of variables

Initialization is unnecessary when the variable is written before it is
read. There were some occasions in which the driver would initialize `ret'
during declaration without need.

Purely a cosmetic change with no functional impact.
Signed-off-by: default avatarHardik Singh Rathore <hardiksingh.k@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 618ab57f
...@@ -43,7 +43,7 @@ static int adt7316_i2c_read(void *client, u8 reg, u8 *data) ...@@ -43,7 +43,7 @@ static int adt7316_i2c_read(void *client, u8 reg, u8 *data)
static int adt7316_i2c_write(void *client, u8 reg, u8 data) static int adt7316_i2c_write(void *client, u8 reg, u8 data)
{ {
struct i2c_client *cl = client; struct i2c_client *cl = client;
int ret = 0; int ret;
ret = i2c_smbus_write_byte_data(cl, reg, data); ret = i2c_smbus_write_byte_data(cl, reg, data);
if (ret < 0) if (ret < 0)
...@@ -55,7 +55,7 @@ static int adt7316_i2c_write(void *client, u8 reg, u8 data) ...@@ -55,7 +55,7 @@ static int adt7316_i2c_write(void *client, u8 reg, u8 data)
static int adt7316_i2c_multi_read(void *client, u8 reg, u8 count, u8 *data) static int adt7316_i2c_multi_read(void *client, u8 reg, u8 count, u8 *data)
{ {
struct i2c_client *cl = client; struct i2c_client *cl = client;
int i, ret = 0; int i, ret;
if (count > ADT7316_REG_MAX_ADDR) if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR; count = ADT7316_REG_MAX_ADDR;
...@@ -74,7 +74,7 @@ static int adt7316_i2c_multi_read(void *client, u8 reg, u8 count, u8 *data) ...@@ -74,7 +74,7 @@ static int adt7316_i2c_multi_read(void *client, u8 reg, u8 count, u8 *data)
static int adt7316_i2c_multi_write(void *client, u8 reg, u8 count, u8 *data) static int adt7316_i2c_multi_write(void *client, u8 reg, u8 count, u8 *data)
{ {
struct i2c_client *cl = client; struct i2c_client *cl = client;
int i, ret = 0; int i, ret;
if (count > ADT7316_REG_MAX_ADDR) if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR; count = ADT7316_REG_MAX_ADDR;
......
...@@ -27,7 +27,7 @@ static int adt7316_spi_multi_read(void *client, u8 reg, u8 count, u8 *data) ...@@ -27,7 +27,7 @@ static int adt7316_spi_multi_read(void *client, u8 reg, u8 count, u8 *data)
{ {
struct spi_device *spi_dev = client; struct spi_device *spi_dev = client;
u8 cmd[2]; u8 cmd[2];
int ret = 0; int ret;
if (count > ADT7316_REG_MAX_ADDR) if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR; count = ADT7316_REG_MAX_ADDR;
...@@ -56,7 +56,7 @@ static int adt7316_spi_multi_write(void *client, u8 reg, u8 count, u8 *data) ...@@ -56,7 +56,7 @@ static int adt7316_spi_multi_write(void *client, u8 reg, u8 count, u8 *data)
{ {
struct spi_device *spi_dev = client; struct spi_device *spi_dev = client;
u8 buf[ADT7316_REG_MAX_ADDR + 2]; u8 buf[ADT7316_REG_MAX_ADDR + 2];
int i, ret = 0; int i, ret;
if (count > ADT7316_REG_MAX_ADDR) if (count > ADT7316_REG_MAX_ADDR)
count = ADT7316_REG_MAX_ADDR; count = ADT7316_REG_MAX_ADDR;
......
...@@ -2092,7 +2092,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, ...@@ -2092,7 +2092,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus,
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
unsigned short *adt7316_platform_data = dev->platform_data; unsigned short *adt7316_platform_data = dev->platform_data;
int irq_type = IRQF_TRIGGER_LOW; int irq_type = IRQF_TRIGGER_LOW;
int ret = 0; int ret;
indio_dev = devm_iio_device_alloc(dev, sizeof(*chip)); indio_dev = devm_iio_device_alloc(dev, sizeof(*chip));
if (!indio_dev) if (!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