Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / drivers / gpu / drm / exynos / exynos_drm_rotator.c
index f18fbe4..6591e40 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
+#include <linux/of_device.h>
 #include <linux/pm_runtime.h>
 
 #include <drm/drmP.h>
@@ -696,7 +697,6 @@ static int rotator_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct rot_context *rot;
        struct exynos_drm_ippdrv *ippdrv;
-       const struct of_device_id *match;
        int ret;
 
        if (!dev->of_node) {
@@ -708,13 +708,8 @@ static int rotator_probe(struct platform_device *pdev)
        if (!rot)
                return -ENOMEM;
 
-       match = of_match_node(exynos_rotator_match, dev->of_node);
-       if (!match) {
-               dev_err(dev, "failed to match node\n");
-               return -ENODEV;
-       }
-       rot->limit_tbl = (struct rot_limit_table *)match->data;
-
+       rot->limit_tbl = (struct rot_limit_table *)
+                               of_device_get_match_data(dev);
        rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        rot->regs = devm_ioremap_resource(dev, rot->regs_res);
        if (IS_ERR(rot->regs))
@@ -799,29 +794,6 @@ static int rotator_clk_crtl(struct rot_context *rot, bool enable)
        return 0;
 }
 
-
-#ifdef CONFIG_PM_SLEEP
-static int rotator_suspend(struct device *dev)
-{
-       struct rot_context *rot = dev_get_drvdata(dev);
-
-       if (pm_runtime_suspended(dev))
-               return 0;
-
-       return rotator_clk_crtl(rot, false);
-}
-
-static int rotator_resume(struct device *dev)
-{
-       struct rot_context *rot = dev_get_drvdata(dev);
-
-       if (!pm_runtime_suspended(dev))
-               return rotator_clk_crtl(rot, true);
-
-       return 0;
-}
-#endif
-
 static int rotator_runtime_suspend(struct device *dev)
 {
        struct rot_context *rot = dev_get_drvdata(dev);
@@ -838,7 +810,8 @@ static int rotator_runtime_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops rotator_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(rotator_suspend, rotator_resume)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+                               pm_runtime_force_resume)
        SET_RUNTIME_PM_OPS(rotator_runtime_suspend, rotator_runtime_resume,
                                                                        NULL)
 };