lkml.org 
[lkml]   [2012]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 03/10] staging: media: go7007: Non main code changing
Date
types cast approved, max channels==4 (ADC), i2c_smbus_write_
return s32 type

Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
---
drivers/staging/media/go7007/wis-tw2804.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/go7007/wis-tw2804.c b/drivers/staging/media/go7007/wis-tw2804.c
index 13f0f63..0b49342 100644
--- a/drivers/staging/media/go7007/wis-tw2804.c
+++ b/drivers/staging/media/go7007/wis-tw2804.c
@@ -111,19 +111,22 @@ static u8 channel_registers[] = {
0xff, 0xff, /* Terminator (reg 0xff does not exist) */
};

-static int write_reg(struct i2c_client *client, u8 reg, u8 value, int channel)
+static s32 write_reg(struct i2c_client *client, u8 reg, u8 value, u8 channel)
{
return i2c_smbus_write_byte_data(client, reg | (channel << 6), value);
}

-static int write_regs(struct i2c_client *client, u8 *regs, int channel)
+static int write_regs(struct i2c_client *client, u8 *regs, u8 channel)
{
int i;

for (i = 0; regs[i] != 0xff; i += 2)
if (i2c_smbus_write_byte_data(client,
regs[i] | (channel << 6), regs[i + 1]) < 0)
- return -1;
+ return -EINVAL;
+ return 0;
+}
+
static s32 read_reg(struct i2c_client *client, u8 reg, u8 channel)
{
return i2c_smbus_read_byte_data(client, (reg) | (channel << 6));
--
1.7.7.6


\
 
 \ /
  Last update: 2012-08-22 12:41    [W:2.247 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site