diff options
author | Hartmut Knaack <knaack.h@gmx.de> | 2015-08-28 23:59:57 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-10-11 15:44:42 +0100 |
commit | acf2f67d055c656938a3980a0745ed62fb7985c9 (patch) | |
tree | 66b44e01a179d90a7b3a5923464f61676f39c356 /drivers/iio/dac | |
parent | 11687d4aaeb074e0a51c8008c80a14c6b8937b3d (diff) |
iio:dac:m62332: address some style issues
Fix some indentation issues and separate returns by empty lines (IIO
style). Also rename the channel mask in _read_raw() to mask.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/dac')
-rw-r--r-- | drivers/iio/dac/m62332.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/iio/dac/m62332.c b/drivers/iio/dac/m62332.c index 1b65fc007bce..fdb3e042c14d 100644 --- a/drivers/iio/dac/m62332.c +++ b/drivers/iio/dac/m62332.c @@ -40,8 +40,7 @@ struct m62332_data { #endif }; -static int m62332_set_value(struct iio_dev *indio_dev, - u8 val, int channel) +static int m62332_set_value(struct iio_dev *indio_dev, u8 val, int channel) { struct m62332_data *data = iio_priv(indio_dev); struct i2c_client *client = data->client; @@ -87,30 +86,35 @@ static int m62332_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, - long m) + long mask) { struct m62332_data *data = iio_priv(indio_dev); - switch (m) { + switch (mask) { case IIO_CHAN_INFO_SCALE: /* Corresponds to Vref / 2^(bits) */ *val = data->vref_mv; *val2 = 8; + return IIO_VAL_FRACTIONAL_LOG2; case IIO_CHAN_INFO_RAW: *val = data->raw[chan->channel]; + return IIO_VAL_INT; case IIO_CHAN_INFO_OFFSET: *val = 1; + return IIO_VAL_INT; default: break; } + return -EINVAL; } static int m62332_write_raw(struct iio_dev *indio_dev, - struct iio_chan_spec const *chan, int val, int val2, long mask) + struct iio_chan_spec const *chan, int val, int val2, + long mask) { switch (mask) { case IIO_CHAN_INFO_RAW: @@ -195,6 +199,7 @@ static int m62332_probe(struct i2c_client *client, indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); if (!indio_dev) return -ENOMEM; + data = iio_priv(indio_dev); i2c_set_clientdata(client, indio_dev); data->client = client; @@ -230,6 +235,7 @@ static int m62332_probe(struct i2c_client *client, err: iio_map_array_unregister(indio_dev); + return ret; } |