diff options
Diffstat (limited to 'drivers/media/video/saa7127.c')
-rw-r--r-- | drivers/media/video/saa7127.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 304375ade4a9..bd9c4f3ad02e 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -615,15 +615,6 @@ static int saa7127_command(struct i2c_client *client, | |||
615 | 615 | ||
616 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 616 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
617 | case VIDIOC_DBG_G_REGISTER: | 617 | case VIDIOC_DBG_G_REGISTER: |
618 | { | ||
619 | struct v4l2_register *reg = arg; | ||
620 | |||
621 | if (reg->i2c_id != I2C_DRIVERID_SAA7127) | ||
622 | return -EINVAL; | ||
623 | reg->val = saa7127_read(client, reg->reg & 0xff); | ||
624 | break; | ||
625 | } | ||
626 | |||
627 | case VIDIOC_DBG_S_REGISTER: | 618 | case VIDIOC_DBG_S_REGISTER: |
628 | { | 619 | { |
629 | struct v4l2_register *reg = arg; | 620 | struct v4l2_register *reg = arg; |
@@ -632,7 +623,10 @@ static int saa7127_command(struct i2c_client *client, | |||
632 | return -EINVAL; | 623 | return -EINVAL; |
633 | if (!capable(CAP_SYS_ADMIN)) | 624 | if (!capable(CAP_SYS_ADMIN)) |
634 | return -EPERM; | 625 | return -EPERM; |
635 | saa7127_write(client, reg->reg & 0xff, reg->val & 0xff); | 626 | if (cmd == VIDIOC_DBG_G_REGISTER) |
627 | reg->val = saa7127_read(client, reg->reg & 0xff); | ||
628 | else | ||
629 | saa7127_write(client, reg->reg & 0xff, reg->val & 0xff); | ||
636 | break; | 630 | break; |
637 | } | 631 | } |
638 | #endif | 632 | #endif |