]> git.baikalelectronics.ru Git - kernel.git/commit
media: staging: allegro: fix broken registration of controls
authorMichael Tretter <m.tretter@pengutronix.de>
Thu, 19 Mar 2020 09:16:30 +0000 (10:16 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 20 Mar 2020 08:05:25 +0000 (09:05 +0100)
commit71e40974d1935495303323a4ebd588d142db5181
treeaf24c4f0a89e99d88ecb6105f73a82aa0b6335f5
parentcda4b9d5c0cac23c9e0e7f8d58c3fca9ffd501df
media: staging: allegro: fix broken registration of controls

Since commit 081ccce9f371 ("media: allegro: add missed checks in
allegro_open()") the allegro device does provide v4l2 controls to user
space anymore. The reason is that v4l2_fh_init() initializes
fh->ctrl_handler to vdev->ctrl_handler, which invalidates the previous
driver override of the ctrl_handler.

Therefore, v4l2_fh_init() must be called before the driver overrides the
fh->ctrl_handler with its own handler.

Move the initialization of the fh back to the top, as the initialization
does not does not need to be reverted on errors, but it is enough to
free the channel.

Fixes: 081ccce9f371 ("media: allegro: add missed checks in allegro_open()")
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/allegro-dvt/allegro-core.c