iio: temperature: tmp117: cosmetic alignment cleanup
Align the code correctly if possible and align the channel bit mask to make it easier to read. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.kernel.org/r/20230228090518.529811-6-m.felsch@pengutronix.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
0cd2889dc1
commit
e942307556
@ -43,8 +43,8 @@ struct tmp117_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int tmp117_read_raw(struct iio_dev *indio_dev,
|
static int tmp117_read_raw(struct iio_dev *indio_dev,
|
||||||
struct iio_chan_spec const *channel, int *val,
|
struct iio_chan_spec const *channel, int *val,
|
||||||
int *val2, long mask)
|
int *val2, long mask)
|
||||||
{
|
{
|
||||||
struct tmp117_data *data = iio_priv(indio_dev);
|
struct tmp117_data *data = iio_priv(indio_dev);
|
||||||
s32 ret;
|
s32 ret;
|
||||||
@ -52,7 +52,7 @@ static int tmp117_read_raw(struct iio_dev *indio_dev,
|
|||||||
switch (mask) {
|
switch (mask) {
|
||||||
case IIO_CHAN_INFO_RAW:
|
case IIO_CHAN_INFO_RAW:
|
||||||
ret = i2c_smbus_read_word_swapped(data->client,
|
ret = i2c_smbus_read_word_swapped(data->client,
|
||||||
TMP117_REG_TEMP);
|
TMP117_REG_TEMP);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
*val = sign_extend32(ret, 15);
|
*val = sign_extend32(ret, 15);
|
||||||
@ -60,7 +60,7 @@ static int tmp117_read_raw(struct iio_dev *indio_dev,
|
|||||||
|
|
||||||
case IIO_CHAN_INFO_CALIBBIAS:
|
case IIO_CHAN_INFO_CALIBBIAS:
|
||||||
ret = i2c_smbus_read_word_swapped(data->client,
|
ret = i2c_smbus_read_word_swapped(data->client,
|
||||||
TMP117_REG_TEMP_OFFSET);
|
TMP117_REG_TEMP_OFFSET);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
*val = sign_extend32(ret, 15);
|
*val = sign_extend32(ret, 15);
|
||||||
@ -82,9 +82,8 @@ static int tmp117_read_raw(struct iio_dev *indio_dev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tmp117_write_raw(struct iio_dev *indio_dev,
|
static int tmp117_write_raw(struct iio_dev *indio_dev, struct iio_chan_spec
|
||||||
struct iio_chan_spec const *channel, int val,
|
const *channel, int val, int val2, long mask)
|
||||||
int val2, long mask)
|
|
||||||
{
|
{
|
||||||
struct tmp117_data *data = iio_priv(indio_dev);
|
struct tmp117_data *data = iio_priv(indio_dev);
|
||||||
s16 off;
|
s16 off;
|
||||||
@ -107,7 +106,8 @@ static const struct iio_chan_spec tmp117_channels[] = {
|
|||||||
{
|
{
|
||||||
.type = IIO_TEMP,
|
.type = IIO_TEMP,
|
||||||
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
|
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
|
||||||
BIT(IIO_CHAN_INFO_CALIBBIAS) | BIT(IIO_CHAN_INFO_SCALE),
|
BIT(IIO_CHAN_INFO_CALIBBIAS) |
|
||||||
|
BIT(IIO_CHAN_INFO_SCALE),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user