staging: iio: cdc: ad7150: use value copy to shorten the line length

By using the copy of channel attribute, we can now make the lines short
enough to eliminate the checkpatch.pl problem:

    CHECK: Alignment should match open parenthesis

Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Slawomir Stepien 2018-10-05 10:04:44 +02:00 committed by Jonathan Cameron
parent 388008bbd6
commit 4bb199e51d
1 changed files with 3 additions and 2 deletions

View File

@ -102,18 +102,19 @@ static int ad7150_read_raw(struct iio_dev *indio_dev,
{ {
int ret; int ret;
struct ad7150_chip_info *chip = iio_priv(indio_dev); struct ad7150_chip_info *chip = iio_priv(indio_dev);
int channel = chan->channel;
switch (mask) { switch (mask) {
case IIO_CHAN_INFO_RAW: case IIO_CHAN_INFO_RAW:
ret = i2c_smbus_read_word_data(chip->client, ret = i2c_smbus_read_word_data(chip->client,
ad7150_addresses[chan->channel][0]); ad7150_addresses[channel][0]);
if (ret < 0) if (ret < 0)
return ret; return ret;
*val = swab16(ret); *val = swab16(ret);
return IIO_VAL_INT; return IIO_VAL_INT;
case IIO_CHAN_INFO_AVERAGE_RAW: case IIO_CHAN_INFO_AVERAGE_RAW:
ret = i2c_smbus_read_word_data(chip->client, ret = i2c_smbus_read_word_data(chip->client,
ad7150_addresses[chan->channel][1]); ad7150_addresses[channel][1]);
if (ret < 0) if (ret < 0)
return ret; return ret;
*val = swab16(ret); *val = swab16(ret);