]> git.baikalelectronics.ru Git - kernel.git/commit
[media] s5p-fimc: Change platform subdevs registration method
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Wed, 12 Dec 2012 11:16:05 +0000 (08:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 5 Feb 2013 19:49:56 +0000 (17:49 -0200)
commitcaf5b91d742ce6ba8f6e51c1fc59e4137879275f
treed7313ea9607b53640209683ed15aaa1bfcd7f8db
parent7ebb98e0f74103a26969a24e66ff2548514f8747
[media] s5p-fimc: Change platform subdevs registration method

The previous method of registering platform entities into the main
driver using driver_find() and then iterating over devices bound to
a driver was racy and is being removed here. Nothing was preventing
module from unloading during a call to try_module_get(driver->owner).
Instead, we look up a device first and then check for its driver while
holding device lock.
The platform sub-devices are looked up and registered to the top
level driver. When any sub-device is not yet initialized and ready
the main driver's probe() will be deferred.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/s5p-fimc/fimc-mdevice.c