[media] s5p-jpeg: fix system and runtime PM integration
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 31 Aug 2016 12:55:59 +0000 (09:55 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 22 Sep 2016 13:11:57 +0000 (10:11 -0300)
Use generic helpers instead of open-coding usage of runtime PM for system
sleep PM, which was potentially broken for some corner cases.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s5p-jpeg/jpeg-core.c

index d5e7762..52dc794 100644 (file)
@@ -3003,26 +3003,9 @@ static int s5p_jpeg_runtime_resume(struct device *dev)
 }
 #endif /* CONFIG_PM */
 
-#ifdef CONFIG_PM_SLEEP
-static int s5p_jpeg_suspend(struct device *dev)
-{
-       if (pm_runtime_suspended(dev))
-               return 0;
-
-       return s5p_jpeg_runtime_suspend(dev);
-}
-
-static int s5p_jpeg_resume(struct device *dev)
-{
-       if (pm_runtime_suspended(dev))
-               return 0;
-
-       return s5p_jpeg_runtime_resume(dev);
-}
-#endif
-
 static const struct dev_pm_ops s5p_jpeg_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(s5p_jpeg_suspend, s5p_jpeg_resume)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+                               pm_runtime_force_resume)
        SET_RUNTIME_PM_OPS(s5p_jpeg_runtime_suspend, s5p_jpeg_runtime_resume,
                           NULL)
 };