summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc/mipi-csis.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-03-21 13:58:09 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-04-10 20:25:25 +0200
commitecd9acbf545a0d7191478eea8a14331baf5ed121 (patch)
tree7a42e6250a6cc78c98d58f1666a43a4256d3c7ec /drivers/media/video/s5p-fimc/mipi-csis.c
parent[media] s5p-fimc: Remove unneeded fields from struct fimc_dev (diff)
downloadlinux-ecd9acbf545a0d7191478eea8a14331baf5ed121.tar.xz
linux-ecd9acbf545a0d7191478eea8a14331baf5ed121.zip
[media] s5p-fimc: Handle sub-device interdependencies using deferred probing
In this driver there are several entities associated with separate platform or I2C client devices, which may get probed in random order. When the platform device bound to the media device driver is probed all other entity drivers need to be already in place and initialized. If any of them is not, fail the media device probe and return an error indicating we need to be retried once any new driver gets registered. The media device driver probe will not succeed until there are available all needed sub-drivers, as specified in the platform data. While at it, make sure the s5p-csis module (MIPI-CSI receiver driver) does not get unloaded when in use, by guarding its usage with try_module_get/module_put. This patch is a prerequisite for adding the device tree support. It now also allows again to unbind/bind the driver at runtime from user space via sysfs. 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>
Diffstat (limited to 'drivers/media/video/s5p-fimc/mipi-csis.c')
-rw-r--r--drivers/media/video/s5p-fimc/mipi-csis.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/media/video/s5p-fimc/mipi-csis.c b/drivers/media/video/s5p-fimc/mipi-csis.c
index 1cd6b6bc6279..2f73d9e3d0b7 100644
--- a/drivers/media/video/s5p-fimc/mipi-csis.c
+++ b/drivers/media/video/s5p-fimc/mipi-csis.c
@@ -715,19 +715,8 @@ static struct platform_driver s5pcsis_driver = {
},
};
-static int __init s5pcsis_init(void)
-{
- return platform_driver_probe(&s5pcsis_driver, s5pcsis_probe);
-}
-
-static void __exit s5pcsis_exit(void)
-{
- platform_driver_unregister(&s5pcsis_driver);
-}
-
-module_init(s5pcsis_init);
-module_exit(s5pcsis_exit);
+module_platform_driver(s5pcsis_driver);
MODULE_AUTHOR("Sylwester Nawrocki <s.nawrocki@samsung.com>");
-MODULE_DESCRIPTION("S5P/EXYNOS4 MIPI CSI receiver driver");
+MODULE_DESCRIPTION("Samsung S5P/EXYNOS SoC MIPI-CSI2 receiver driver");
MODULE_LICENSE("GPL");