OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 10 Oct 2012 11:03:11 +0000 (14:03 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 7 Dec 2012 15:05:56 +0000 (17:05 +0200)
We have two functions to wait for a dispc interrupt:

int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,

Of these, the former is not used at all, and can be removed. The latter
is only used by the compat layer, and can be moved to the compat layer
code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/dispc-compat.c
drivers/video/omap2/dss/dispc-compat.h
drivers/video/omap2/dss/dispc.c
include/video/omapdss.h

index cca38488ab27aacf7f83f85757f0832cc5807593..24e1d5e974eb35b4365dff32698f1398034420d1 100644 (file)
@@ -205,3 +205,33 @@ void dispc_mgr_disable_sync(enum omap_channel channel)
                WARN_ON(1);
 }
 
+int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
+               unsigned long timeout)
+{
+       void dispc_irq_wait_handler(void *data, u32 mask)
+       {
+               complete((struct completion *)data);
+       }
+
+       int r;
+       DECLARE_COMPLETION_ONSTACK(completion);
+
+       r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
+                       irqmask);
+
+       if (r)
+               return r;
+
+       timeout = wait_for_completion_interruptible_timeout(&completion,
+                       timeout);
+
+       omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
+
+       if (timeout == 0)
+               return -ETIMEDOUT;
+
+       if (timeout == -ERESTARTSYS)
+               return -ERESTARTSYS;
+
+       return 0;
+}
index 2d4f5e77a7bf1fa8ac55497b32254afbfffecec9..8322d43d28c3bb0171ff565732a3d551bed4ceb4 100644 (file)
@@ -21,4 +21,7 @@
 void dispc_mgr_enable_sync(enum omap_channel channel);
 void dispc_mgr_disable_sync(enum omap_channel channel);
 
+int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
+               unsigned long timeout);
+
 #endif
index 73972e99ec6346d6315ef82b98b051fba5954a0a..f7c734214022d4dddf3cb2e6d0a000ec345f61fe 100644 (file)
@@ -3750,63 +3750,6 @@ static void dispc_error_worker(struct work_struct *work)
        dispc_runtime_put();
 }
 
-int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout)
-{
-       void dispc_irq_wait_handler(void *data, u32 mask)
-       {
-               complete((struct completion *)data);
-       }
-
-       int r;
-       DECLARE_COMPLETION_ONSTACK(completion);
-
-       r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
-                       irqmask);
-
-       if (r)
-               return r;
-
-       timeout = wait_for_completion_timeout(&completion, timeout);
-
-       omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
-
-       if (timeout == 0)
-               return -ETIMEDOUT;
-
-       return 0;
-}
-
-int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
-               unsigned long timeout)
-{
-       void dispc_irq_wait_handler(void *data, u32 mask)
-       {
-               complete((struct completion *)data);
-       }
-
-       int r;
-       DECLARE_COMPLETION_ONSTACK(completion);
-
-       r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
-                       irqmask);
-
-       if (r)
-               return r;
-
-       timeout = wait_for_completion_interruptible_timeout(&completion,
-                       timeout);
-
-       omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
-
-       if (timeout == 0)
-               return -ETIMEDOUT;
-
-       if (timeout == -ERESTARTSYS)
-               return -ERESTARTSYS;
-
-       return 0;
-}
-
 static void _omap_dispc_initialize_irq(void)
 {
        unsigned long flags;
index a9402362d8178857b483e171244c95003885171c..823a07b00fe5fa45e06131030b0d3769d302530a 100644 (file)
@@ -775,10 +775,6 @@ typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
 int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
 int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
 
-int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
-int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
-               unsigned long timeout);
-
 #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
 #define to_dss_device(x) container_of((x), struct omap_dss_device, dev)