diff options
Diffstat (limited to 'linux/drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtv-ioctl.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-ioctl.c b/linux/drivers/media/video/ivtv/ivtv-ioctl.c index 36af92e50..f8107e337 100644 --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c @@ -662,18 +662,26 @@ static int ivtv_internal_ioctls(struct file *filp, unsigned int cmd, void *arg) return ivtv_i2c_id(itv, reg->match_chip, cmd, arg); return ivtv_call_i2c_client(itv, reg->match_chip, cmd, arg); - case VIDIOC_G_CHIP_IDENT: + case VIDIOC_G_CHIP_IDENT: { + struct v4l2_chip_ident *chip = arg; + IVTV_DEBUG_IOCTL("VIDIOC_G_CHIP_IDENT\n"); - if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) { - struct v4l2_chip_ident *chip = arg; + chip->ident = V4L2_IDENT_NONE; + chip->revision = 0; + if (reg->match_type == V4L2_CHIP_MATCH_HOST) { + if (v4l2_chip_match_host(reg->match_type, reg->match_chip)) { + struct v4l2_chip_ident *chip = arg; - chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416; - chip->revision = 0; + chip->ident = itv->has_cx23415 ? V4L2_IDENT_CX23415 : V4L2_IDENT_CX23416; + } return 0; } if (reg->match_type == V4L2_CHIP_MATCH_I2C_DRIVER) return ivtv_i2c_id(itv, reg->match_chip, cmd, arg); - return ivtv_call_i2c_client(itv, reg->match_chip, cmd, arg); + if (reg->match_type == V4L2_CHIP_MATCH_I2C_ADDR) + return ivtv_call_i2c_client(itv, reg->match_chip, cmd, arg); + return -EINVAL; + } case VIDIOC_INT_S_AUDIO_ROUTING: { struct v4l2_routing *route = arg; |