Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181698
b: refs/heads/master
c: dfbd5d4
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 7207872 commit d61d1d5
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 0b67553657330b5ad5c78a974ce84273a515fe4e
refs/heads/master: dfbd5d4d324e630aedc40b7519351a9c0fe94dc9
16 changes: 6 additions & 10 deletions trunk/drivers/media/video/tvp7002.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,13 +859,17 @@ static int tvp7002_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
u8 val;
int ret;

if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;

return reg->val < 0 ? -EINVAL : 0;
ret = tvp7002_read(sd, reg->reg & 0xff, &val);
reg->val = val;
return ret;
}

/*
Expand All @@ -881,21 +885,13 @@ static int tvp7002_s_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg)
{
struct i2c_client *client = v4l2_get_subdevdata(sd);
struct tvp7002 *device = to_tvp7002(sd);
int wres;

if (!v4l2_chip_match_i2c_client(client, &reg->match))
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;

wres = tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff);

/* Update the register value in device's table */
if (!wres)
device->registers[reg->reg].value = reg->val;

return wres < 0 ? -EINVAL : 0;
return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff);
}
#endif

Expand Down

0 comments on commit d61d1d5

Please sign in to comment.