From ef5e52021856647afdbf2f88b5564cb22250290b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 27 Feb 2007 20:06:09 +0100 Subject: Improve VIDIOC_G_CHIP_IDENT (better diagnostics) From: Hans Verkuil Simplify the VIDIOC_G_CHIP_IDENT implementation by adding a single common function. The ident can now also return NONE: not found, UNKNOWN: found, but we don't know what chip it is, and AMBIGUOUS: multiple chips were matched so the match values were too general. Signed-off-by: Hans Verkuil --- linux/drivers/media/video/cx25840/cx25840-core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'linux/drivers/media/video/cx25840') diff --git a/linux/drivers/media/video/cx25840/cx25840-core.c b/linux/drivers/media/video/cx25840/cx25840-core.c index d5a0789bc..c401c1ee7 100644 --- a/linux/drivers/media/video/cx25840/cx25840-core.c +++ b/linux/drivers/media/video/cx25840/cx25840-core.c @@ -840,15 +840,7 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd, break; case VIDIOC_G_CHIP_IDENT: - { - struct v4l2_chip_ident *chip = arg; - - if (!v4l2_chip_match_i2c_client(client, chip->match_type, chip->match_chip)) - return -EINVAL; - chip->ident = state->id; - chip->revision = state->rev; - break; - } + return v4l2_chip_ident_i2c_client(client, arg, state->id, state->rev); default: return -EINVAL; -- cgit v1.2.3