diff options
author | Melissa Wen <melissa.srw@gmail.com> | 2019-06-14 13:32:54 -0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-06-17 21:06:49 +0100 |
commit | 28c7901451b662c0bf200ed22c110e212e40f3ba (patch) | |
tree | fe6f94d7684c5fde6ca449c64b29584d7f8e4a51 /drivers/staging/iio/cdc | |
parent | 34b94f9383138acc892f460bfcb9a35581e048fd (diff) |
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: Melissa Wen <melissa.srw@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/staging/iio/cdc')
-rw-r--r-- | drivers/staging/iio/cdc/ad7150.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index aa750a9178e8..b91af7385ca6 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c @@ -202,16 +202,11 @@ static int ad7150_write_event_params(struct iio_dev *indio_dev, ret = i2c_smbus_write_byte_data(chip->client, ad7150_addresses[chan][4], sens); - if (ret < 0) + if (ret) return ret; - - ret = i2c_smbus_write_byte_data(chip->client, + return i2c_smbus_write_byte_data(chip->client, ad7150_addresses[chan][5], timeout); - if (ret < 0) - return ret; - - return 0; } static int ad7150_write_event_config(struct iio_dev *indio_dev, |