media: em28xx: fix handler for vidioc_s_input()
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 14 Sep 2018 17:13:15 +0000 (13:13 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:53 +0000 (11:08 -0800)
commit9a79eb1233e27933b351973473311f42b41e4de3
treecabf57f914b19f089c49fc810c2972a764bf64ca
parent3e2e4d05b50b5033df9d6bc7527c3fe2566f3884
media: em28xx: fix handler for vidioc_s_input()

commit 258c430456ba5f0005043762e14fc3be35983aaf upstream.

The a->index is not the name of the internal amux entry,
but, instead a value from zero to the maximum number
of audio inputs.

As the actual available inputs depend on each board, build
it dynamically.

This is broken for a really long time. On a quick check,
since at least commit 195a4ef627e1 ("V4L/DVB (6585): Convert
em28xx to video_ioctl2") this was not implemented right.

Fixes: 195a4ef627e1 ("V4L/DVB (6585): Convert em28xx to video_ioctl2")

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/em28xx/em28xx-cards.c
drivers/media/usb/em28xx/em28xx-video.c
drivers/media/usb/em28xx/em28xx.h