Skip to content

Commit e4a67df

Browse files
keesbzolnier
authored andcommitted
video: fbdev: pxa3xx_gcu: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. This also fixes the use of the "priv" variable in QERROR(), since it was pointing to struct timer_list, not struct pxa3xx_gcu_priv. Signed-off-by: Kees Cook <[email protected]> Cc: "Gustavo A. R. Silva" <[email protected]> Cc: Himanshu Jha <[email protected]> [b.zolnierkie: trivial build fixup] Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
1 parent ac831a3 commit e4a67df

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/video/fbdev/pxa3xx-gcu.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,24 +512,26 @@ pxa3xx_gcu_mmap(struct file *file, struct vm_area_struct *vma)
512512

513513
#ifdef PXA3XX_GCU_DEBUG_TIMER
514514
static struct timer_list pxa3xx_gcu_debug_timer;
515+
static struct pxa3xx_gcu_priv *debug_timer_priv;
515516

516-
static void pxa3xx_gcu_debug_timedout(unsigned long ptr)
517+
static void pxa3xx_gcu_debug_timedout(struct timer_list *unused)
517518
{
518-
struct pxa3xx_gcu_priv *priv = (struct pxa3xx_gcu_priv *) ptr;
519+
struct pxa3xx_gcu_priv *priv = debug_timer_priv;
519520

520521
QERROR("Timer DUMP");
521522

522-
/* init the timer structure */
523-
setup_timer(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, ptr);
524523
mod_timer(&pxa3xx_gcu_debug_timer, jiffies + 5 * HZ);
525524
}
526525

527-
static void pxa3xx_gcu_init_debug_timer(void)
526+
static void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *priv)
528527
{
529-
pxa3xx_gcu_debug_timedout((unsigned long) &pxa3xx_gcu_debug_timer);
528+
/* init the timer structure */
529+
debug_timer_priv = priv;
530+
timer_setup(&pxa3xx_gcu_debug_timer, pxa3xx_gcu_debug_timedout, 0);
531+
pxa3xx_gcu_debug_timedout(NULL);
530532
}
531533
#else
532-
static inline void pxa3xx_gcu_init_debug_timer(void) {}
534+
static inline void pxa3xx_gcu_init_debug_timer(struct pxa3xx_gcu_priv *priv) {}
533535
#endif
534536

535537
static int
@@ -666,7 +668,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
666668
platform_set_drvdata(pdev, priv);
667669
priv->resource_mem = r;
668670
pxa3xx_gcu_reset(priv);
669-
pxa3xx_gcu_init_debug_timer();
671+
pxa3xx_gcu_init_debug_timer(priv);
670672

671673
dev_info(dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n",
672674
(void *) r->start, (void *) priv->shared_phys,

0 commit comments

Comments
 (0)