upstream: [media] media: v4l2-dev: fix video device index assignment
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 3 Dec 2013 13:14:29 +0000 (10:14 -0300)
committerChanho Park <chanho61.park@samsung.com>
Thu, 7 Aug 2014 05:26:25 +0000 (14:26 +0900)
commitb05e673103a55a9b90b7a79ba0855b4e60fe56f0
tree796010241ab5bc16745fa704596d19a907d21308
parent16052df45771ed381bebc643991e0b043d05f2d3
upstream: [media] media: v4l2-dev: fix video device index assignment

The side effect of commit 1056e4388b045 ("v4l2-dev: Fix race condition on
__video_register_device") is the increased number of index value assigned
on video_device registration. Before that commit video_devices were
numbered from 0, after it, the indexes starts from 1, because get_index()
always count the device, which is being registered. Some device drivers
rely on video_device index number for internal purposes, i.e. s5p-mfc
driver stopped working after that patch. This patch restores the old method
of numbering the video_device indexes.

Cc: stable@vger.kernel.org # for v3.12
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Ricardo Ribalda <ricardo.ribalda@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-dev.c