Commit 28c79014 authored by Melissa Wen's avatar Melissa Wen Committed by Jonathan Cameron

staging: iio: ad7150: simplify i2c SMBus return treatment

Since i2c_smbus_write_byte_data returns no-positive value, this commit
making the treatment of its return value less verbose.
Signed-off-by: default avatarMelissa Wen <melissa.srw@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 34b94f93
...@@ -202,16 +202,11 @@ static int ad7150_write_event_params(struct iio_dev *indio_dev, ...@@ -202,16 +202,11 @@ static int ad7150_write_event_params(struct iio_dev *indio_dev,
ret = i2c_smbus_write_byte_data(chip->client, ret = i2c_smbus_write_byte_data(chip->client,
ad7150_addresses[chan][4], ad7150_addresses[chan][4],
sens); sens);
if (ret < 0) if (ret)
return ret; return ret;
return i2c_smbus_write_byte_data(chip->client,
ret = i2c_smbus_write_byte_data(chip->client,
ad7150_addresses[chan][5], ad7150_addresses[chan][5],
timeout); timeout);
if (ret < 0)
return ret;
return 0;
} }
static int ad7150_write_event_config(struct iio_dev *indio_dev, static int ad7150_write_event_config(struct iio_dev *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