diff --git a/drivers/dma/pxp/pxp_dma_v2.c b/drivers/dma/pxp/pxp_dma_v2.c index 7b01024d87e4a49d7fbfa94da7965cab75f5241a..2fe91b76812afad87a012bfe3b745a65dd424c35 100644 --- a/drivers/dma/pxp/pxp_dma_v2.c +++ b/drivers/dma/pxp/pxp_dma_v2.c @@ -1139,9 +1139,9 @@ static inline void clkoff_callback(struct work_struct *w) pxp_clk_disable(pxp); } -static void pxp_clkoff_timer(unsigned long arg) +static void pxp_clkoff_timer(struct timer_list *t) { - struct pxps *pxp = (struct pxps *)arg; + struct pxps *pxp = from_timer(pxp, t, clk_timer); if ((pxp->pxp_ongoing == 0) && list_empty(&head)) schedule_work(&pxp->work); @@ -1747,9 +1747,7 @@ static int pxp_probe(struct platform_device *pdev) pxp_clk_disable(pxp); INIT_WORK(&pxp->work, clkoff_callback); - init_timer(&pxp->clk_timer); - pxp->clk_timer.function = pxp_clkoff_timer; - pxp->clk_timer.data = (unsigned long)pxp; + timer_setup(&pxp->clk_timer, pxp_clkoff_timer, 0); init_waitqueue_head(&pxp->thread_waitq); /* allocate a kernel thread to dispatch pxp conf */ diff --git a/drivers/dma/pxp/pxp_dma_v3.c b/drivers/dma/pxp/pxp_dma_v3.c index 4d5dd3d9d763367aad1c35eaaeb7ec99384d5946..b9786c725b6a2efbeaf7188f56647c0de4ad91ad 100644 --- a/drivers/dma/pxp/pxp_dma_v3.c +++ b/drivers/dma/pxp/pxp_dma_v3.c @@ -3200,9 +3200,9 @@ static inline void clkoff_callback(struct work_struct *w) pxp_clk_disable(pxp); } -static void pxp_clkoff_timer(unsigned long arg) +static void pxp_clkoff_timer(struct timer_list *t) { - struct pxps *pxp = (struct pxps *)arg; + struct pxps *pxp = from_timer(pxp, t, clk_timer); if ((pxp->pxp_ongoing == 0) && list_empty(&head)) schedule_work(&pxp->work); @@ -6923,9 +6923,7 @@ static void pxp_init_timer(struct pxps *pxp) { INIT_WORK(&pxp->work, clkoff_callback); - init_timer(&pxp->clk_timer); - pxp->clk_timer.function = pxp_clkoff_timer; - pxp->clk_timer.data = (unsigned long)pxp; + timer_setup(&pxp->clk_timer, pxp_clkoff_timer, 0); } static bool is_mux_node(uint32_t node_id)