From bcdc4bd356c76a5bab2f480a73f089dc8e0e4e89 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 03:02:23 -0700 Subject: dmaengine: 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. Signed-off-by: Kees Cook Signed-off-by: Vinod Koul --- drivers/dma/imx-dma.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/dma/imx-dma.c') diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index f681df8f0ed3..331f863c605e 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -364,9 +364,9 @@ static void imxdma_disable_hw(struct imxdma_channel *imxdmac) local_irq_restore(flags); } -static void imxdma_watchdog(unsigned long data) +static void imxdma_watchdog(struct timer_list *t) { - struct imxdma_channel *imxdmac = (struct imxdma_channel *)data; + struct imxdma_channel *imxdmac = from_timer(imxdmac, t, watchdog); struct imxdma_engine *imxdma = imxdmac->imxdma; int channel = imxdmac->channel; @@ -1153,9 +1153,7 @@ static int __init imxdma_probe(struct platform_device *pdev) } imxdmac->irq = irq + i; - init_timer(&imxdmac->watchdog); - imxdmac->watchdog.function = &imxdma_watchdog; - imxdmac->watchdog.data = (unsigned long)imxdmac; + timer_setup(&imxdmac->watchdog, imxdma_watchdog, 0); } imxdmac->imxdma = imxdma; -- cgit v1.2.3