Commit 1ff52fa0 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab

[media] ad5820: Fix sparse warning

Use a type with explicit endianness in machine to big endian conversion.
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent c57a68a1
...@@ -65,16 +65,17 @@ static int ad5820_write(struct ad5820_device *coil, u16 data) ...@@ -65,16 +65,17 @@ static int ad5820_write(struct ad5820_device *coil, u16 data)
{ {
struct i2c_client *client = v4l2_get_subdevdata(&coil->subdev); struct i2c_client *client = v4l2_get_subdevdata(&coil->subdev);
struct i2c_msg msg; struct i2c_msg msg;
__be16 be_data;
int r; int r;
if (!client->adapter) if (!client->adapter)
return -ENODEV; return -ENODEV;
data = cpu_to_be16(data); be_data = cpu_to_be16(data);
msg.addr = client->addr; msg.addr = client->addr;
msg.flags = 0; msg.flags = 0;
msg.len = 2; msg.len = 2;
msg.buf = (u8 *)&data; msg.buf = (u8 *)&be_data;
r = i2c_transfer(client->adapter, &msg, 1); r = i2c_transfer(client->adapter, &msg, 1);
if (r < 0) { if (r < 0) {
......
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