Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219169
b: refs/heads/master
c: 2476410
h: refs/heads/master
i:
  219167: 27855e7
v: v3
  • Loading branch information
Jean Delvare authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent becedb7 commit 8831472
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0a4714c404dfd0c28092743dd8bc244fcda357a
refs/heads/master: 24764107ec78230304811b11334090f65d1bc352
23 changes: 13 additions & 10 deletions trunk/drivers/media/dvb/frontends/cx22702.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,33 +92,36 @@ static int cx22702_writereg(struct cx22702_state *state, u8 reg, u8 data)

ret = i2c_transfer(state->i2c, &msg, 1);

if (ret != 1)
if (unlikely(ret != 1)) {
printk(KERN_ERR
"%s: error (reg == 0x%02x, val == 0x%02x, ret == %i)\n",
__func__, reg, data, ret);
return -1;
}

return (ret != 1) ? -1 : 0;
return 0;
}

static u8 cx22702_readreg(struct cx22702_state *state, u8 reg)
{
int ret;
u8 b0[] = { reg };
u8 b1[] = { 0 };
u8 data;

struct i2c_msg msg[] = {
{ .addr = state->config->demod_address, .flags = 0,
.buf = b0, .len = 1 },
.buf = &reg, .len = 1 },
{ .addr = state->config->demod_address, .flags = I2C_M_RD,
.buf = b1, .len = 1 } };
.buf = &data, .len = 1 } };

ret = i2c_transfer(state->i2c, msg, 2);

if (ret != 2)
printk(KERN_ERR "%s: readreg error (ret == %i)\n",
__func__, ret);
if (unlikely(ret != 2)) {
printk(KERN_ERR "%s: error (reg == 0x%02x, ret == %i)\n",
__func__, reg, ret);
return 0;
}

return b1[0];
return data;
}

static int cx22702_set_inversion(struct cx22702_state *state, int inversion)
Expand Down

0 comments on commit 8831472

Please sign in to comment.