media: vimc: handle error in vimc_add_subdevs
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Sat, 28 Mar 2020 07:52:51 +0000 (08:52 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 14 Apr 2020 10:01:43 +0000 (12:01 +0200)
commit7a040cf303438c567fceb987f10cfd058619f2c9
tree48ff67b86070f5369cd2bab73876d4a0a1acdf89
parent4ce4646c23373b20a156b73b398dc04aea14fce8
media: vimc: handle error in vimc_add_subdevs

In case the 'add' callback of an entity fails,
then all other entities should unregister and released.
This should be done inside vimc_add_subdevs so that
the function handles its own failure.

In order to call vimc_unregister_subdevs and vimc_release_subdevs from
vimc_add_subdevs, the order of the function should change.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/test_drivers/vimc/vimc-core.c