diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 1f606d816a58..b5fc3cc61888 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -1894,16 +1894,11 @@ static int bttv_enum_input(struct file *file, void *priv, | |||
1894 | { | 1894 | { |
1895 | struct bttv_fh *fh = priv; | 1895 | struct bttv_fh *fh = priv; |
1896 | struct bttv *btv = fh->btv; | 1896 | struct bttv *btv = fh->btv; |
1897 | unsigned int n; | 1897 | int n; |
1898 | 1898 | ||
1899 | n = i->index; | 1899 | if (i->index >= bttv_tvcards[btv->c.type].video_inputs) |
1900 | |||
1901 | if (n >= bttv_tvcards[btv->c.type].video_inputs) | ||
1902 | return -EINVAL; | 1900 | return -EINVAL; |
1903 | 1901 | ||
1904 | memset(i, 0, sizeof(*i)); | ||
1905 | |||
1906 | i->index = n; | ||
1907 | i->type = V4L2_INPUT_TYPE_CAMERA; | 1902 | i->type = V4L2_INPUT_TYPE_CAMERA; |
1908 | i->audioset = 1; | 1903 | i->audioset = 1; |
1909 | 1904 | ||
@@ -2952,7 +2947,6 @@ static int bttv_g_tuner(struct file *file, void *priv, | |||
2952 | return -EINVAL; | 2947 | return -EINVAL; |
2953 | 2948 | ||
2954 | mutex_lock(&btv->lock); | 2949 | mutex_lock(&btv->lock); |
2955 | memset(t, 0, sizeof(*t)); | ||
2956 | t->rxsubchans = V4L2_TUNER_SUB_MONO; | 2950 | t->rxsubchans = V4L2_TUNER_SUB_MONO; |
2957 | bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); | 2951 | bttv_call_i2c_clients(btv, VIDIOC_G_TUNER, t); |
2958 | strcpy(t->name, "Television"); | 2952 | strcpy(t->name, "Television"); |
@@ -3495,7 +3489,6 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t) | |||
3495 | if (0 != t->index) | 3489 | if (0 != t->index) |
3496 | return -EINVAL; | 3490 | return -EINVAL; |
3497 | mutex_lock(&btv->lock); | 3491 | mutex_lock(&btv->lock); |
3498 | memset(t, 0, sizeof(*t)); | ||
3499 | strcpy(t->name, "Radio"); | 3492 | strcpy(t->name, "Radio"); |
3500 | t->type = V4L2_TUNER_RADIO; | 3493 | t->type = V4L2_TUNER_RADIO; |
3501 | 3494 | ||