Commit 28799cea authored by H. Nikolaus Schaller's avatar H. Nikolaus Schaller Committed by Jonathan Cameron

iio: mpu6050: improve code readability

- use temporary variable in get_mount_matrix()
- remove , after { }
Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 8d7ea738
...@@ -796,12 +796,14 @@ static const struct iio_mount_matrix * ...@@ -796,12 +796,14 @@ static const struct iio_mount_matrix *
inv_get_mount_matrix(const struct iio_dev *indio_dev, inv_get_mount_matrix(const struct iio_dev *indio_dev,
const struct iio_chan_spec *chan) const struct iio_chan_spec *chan)
{ {
return &((struct inv_mpu6050_state *)iio_priv(indio_dev))->orientation; struct inv_mpu6050_state *data = iio_priv(indio_dev);
return &data->orientation;
} }
static const struct iio_chan_spec_ext_info inv_ext_info[] = { static const struct iio_chan_spec_ext_info inv_ext_info[] = {
IIO_MOUNT_MATRIX(IIO_SHARED_BY_TYPE, inv_get_mount_matrix), IIO_MOUNT_MATRIX(IIO_SHARED_BY_TYPE, inv_get_mount_matrix),
{ }, { }
}; };
#define INV_MPU6050_CHAN(_type, _channel2, _index) \ #define INV_MPU6050_CHAN(_type, _channel2, _index) \
......
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