Commit 7f709dcd authored by Ico Doornekamp's avatar Ico Doornekamp Committed by Jonathan Cameron

iio: magnetometer: ak8974: small endianness fixes

Fixes two cases of 'cast to restricted __le16' as reported by sparse.
Signed-off-by: default avatarIco Doornekamp <ico@pruts.nl>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 23123cd8
...@@ -287,7 +287,7 @@ static int ak8974_await_drdy(struct ak8974 *ak8974) ...@@ -287,7 +287,7 @@ static int ak8974_await_drdy(struct ak8974 *ak8974)
return 0; return 0;
} }
static int ak8974_getresult(struct ak8974 *ak8974, s16 *result) static int ak8974_getresult(struct ak8974 *ak8974, __le16 *result)
{ {
unsigned int src; unsigned int src;
int ret; int ret;
...@@ -395,7 +395,7 @@ static int ak8974_selftest(struct ak8974 *ak8974) ...@@ -395,7 +395,7 @@ static int ak8974_selftest(struct ak8974 *ak8974)
static int ak8974_get_u16_val(struct ak8974 *ak8974, u8 reg, u16 *val) static int ak8974_get_u16_val(struct ak8974 *ak8974, u8 reg, u16 *val)
{ {
int ret; int ret;
u16 bulk; __le16 bulk;
ret = regmap_bulk_read(ak8974->map, reg, &bulk, 2); ret = regmap_bulk_read(ak8974->map, reg, &bulk, 2);
if (ret) if (ret)
...@@ -453,7 +453,7 @@ static int ak8974_read_raw(struct iio_dev *indio_dev, ...@@ -453,7 +453,7 @@ static int ak8974_read_raw(struct iio_dev *indio_dev,
long mask) long mask)
{ {
struct ak8974 *ak8974 = iio_priv(indio_dev); struct ak8974 *ak8974 = iio_priv(indio_dev);
s16 hw_values[3]; __le16 hw_values[3];
int ret = -EINVAL; int ret = -EINVAL;
pm_runtime_get_sync(&ak8974->i2c->dev); pm_runtime_get_sync(&ak8974->i2c->dev);
...@@ -494,7 +494,7 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) ...@@ -494,7 +494,7 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev)
{ {
struct ak8974 *ak8974 = iio_priv(indio_dev); struct ak8974 *ak8974 = iio_priv(indio_dev);
int ret; int ret;
s16 hw_values[8]; /* Three axes + 64bit padding */ __le16 hw_values[8]; /* Three axes + 64bit padding */
pm_runtime_get_sync(&ak8974->i2c->dev); pm_runtime_get_sync(&ak8974->i2c->dev);
mutex_lock(&ak8974->lock); mutex_lock(&ak8974->lock);
......
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