summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/ad5820.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2016-09-16 07:16:30 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-24 17:37:12 -0200
commit1ff52fa0f19c407e0e091bf0c8e169ee017ef725 (patch)
treea0a5065acf6df364d8c3aa55b68d388306c49f3a /drivers/media/i2c/ad5820.c
parentc57a68a152dc7e2d0631acb9d3c00d1c33ddecfb (diff)
[media] ad5820: Fix sparse warning
Use a type with explicit endianness in machine to big endian conversion. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/ad5820.c')
-rw-r--r--drivers/media/i2c/ad5820.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c
index beab2f381b81..a9026a91855e 100644
--- a/drivers/media/i2c/ad5820.c
+++ b/drivers/media/i2c/ad5820.c
@@ -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_msg msg;
+ __be16 be_data;
int r;
if (!client->adapter)
return -ENODEV;
- data = cpu_to_be16(data);
+ be_data = cpu_to_be16(data);
msg.addr = client->addr;
msg.flags = 0;
msg.len = 2;
- msg.buf = (u8 *)&data;
+ msg.buf = (u8 *)&be_data;
r = i2c_transfer(client->adapter, &msg, 1);
if (r < 0) {