upstream: [media] v4l: Only get module if it's different than the driver for v4l2_dev
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 12 Dec 2013 12:36:46 +0000 (09:36 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:55:15 +0000 (11:55 +0900)
commit63f157d39f6e69a3bcb702b649939a42c29c8803
tree998845c002b8773ba2168017608e3f2f75fb17fd
parent082692401af11b6f8af20a1a9c5c0c2cdfc1f259
upstream: [media] v4l: Only get module if it's different than the driver for v4l2_dev

When the sub-device is registered, increment the use count of the sub-device
owner only if it's different from the owner of the driver for the media
device. This avoids increasing the use count by the module itself and thus
making it possible to unload it when it's not in use.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-device.c
include/media/v4l2-subdev.h