Skip to content

Commit 549acbe

Browse files
committed
OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c
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>
1 parent bb39813 commit 549acbe

4 files changed

Lines changed: 33 additions & 61 deletions

File tree

‎drivers/video/omap2/dss/dispc-compat.c‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,33 @@ void dispc_mgr_disable_sync(enum omap_channel channel)
205205
WARN_ON(1);
206206
}
207207

208+
int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
209+
unsigned long timeout)
210+
{
211+
void dispc_irq_wait_handler(void *data, u32 mask)
212+
{
213+
complete((struct completion *)data);
214+
}
215+
216+
int r;
217+
DECLARE_COMPLETION_ONSTACK(completion);
218+
219+
r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
220+
irqmask);
221+
222+
if (r)
223+
return r;
224+
225+
timeout = wait_for_completion_interruptible_timeout(&completion,
226+
timeout);
227+
228+
omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
229+
230+
if (timeout == 0)
231+
return -ETIMEDOUT;
232+
233+
if (timeout == -ERESTARTSYS)
234+
return -ERESTARTSYS;
235+
236+
return 0;
237+
}

‎drivers/video/omap2/dss/dispc-compat.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@
2121
void dispc_mgr_enable_sync(enum omap_channel channel);
2222
void dispc_mgr_disable_sync(enum omap_channel channel);
2323

24+
int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
25+
unsigned long timeout);
26+
2427
#endif

‎drivers/video/omap2/dss/dispc.c‎

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,63 +3750,6 @@ static void dispc_error_worker(struct work_struct *work)
37503750
dispc_runtime_put();
37513751
}
37523752

3753-
int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout)
3754-
{
3755-
void dispc_irq_wait_handler(void *data, u32 mask)
3756-
{
3757-
complete((struct completion *)data);
3758-
}
3759-
3760-
int r;
3761-
DECLARE_COMPLETION_ONSTACK(completion);
3762-
3763-
r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
3764-
irqmask);
3765-
3766-
if (r)
3767-
return r;
3768-
3769-
timeout = wait_for_completion_timeout(&completion, timeout);
3770-
3771-
omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
3772-
3773-
if (timeout == 0)
3774-
return -ETIMEDOUT;
3775-
3776-
return 0;
3777-
}
3778-
3779-
int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
3780-
unsigned long timeout)
3781-
{
3782-
void dispc_irq_wait_handler(void *data, u32 mask)
3783-
{
3784-
complete((struct completion *)data);
3785-
}
3786-
3787-
int r;
3788-
DECLARE_COMPLETION_ONSTACK(completion);
3789-
3790-
r = omap_dispc_register_isr(dispc_irq_wait_handler, &completion,
3791-
irqmask);
3792-
3793-
if (r)
3794-
return r;
3795-
3796-
timeout = wait_for_completion_interruptible_timeout(&completion,
3797-
timeout);
3798-
3799-
omap_dispc_unregister_isr(dispc_irq_wait_handler, &completion, irqmask);
3800-
3801-
if (timeout == 0)
3802-
return -ETIMEDOUT;
3803-
3804-
if (timeout == -ERESTARTSYS)
3805-
return -ERESTARTSYS;
3806-
3807-
return 0;
3808-
}
3809-
38103753
static void _omap_dispc_initialize_irq(void)
38113754
{
38123755
unsigned long flags;

‎include/video/omapdss.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,10 +775,6 @@ typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
775775
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
776776
int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
777777

778-
int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
779-
int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,
780-
unsigned long timeout);
781-
782778
#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
783779
#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
784780

0 commit comments

Comments
 (0)