media: cedrus: Fix initialization order
authorJernej Skrabec <jernej.skrabec@siol.net>
Sun, 7 Apr 2019 18:47:28 +0000 (14:47 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 22 Apr 2019 15:44:34 +0000 (11:44 -0400)
commitbac875349f8525a75760d0eee525186cb59658ea
treef954eb76a1eeb03d6f89c258e6fd62dd4df97bfa
parentdad7e270ba712ba1c99cd2d91018af6044447a06
media: cedrus: Fix initialization order

Currently, MEDIA_IOC_G_TOPOLOGY ioctl on cedrus fails due to incorrect
initialization order. Fix that by moving video_register_device() before
v4l2_m2m_register_media_controller() and while at it, fix error path.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/staging/media/sunxi/cedrus/cedrus.c