MLK-14314-12 dma: pxp-v3: refine pxp timer init in probe()
authorFancy Fang <chen.fang@nxp.com>
Fri, 3 Mar 2017 01:07:20 +0000 (09:07 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:10 +0000 (15:22 -0500)
Extract the timer initialization from pxp_probe()
to a seperate function call to make probing process
more clear.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c8a127e506bca2e38fae02c03ceae4e6956d6ea3)

drivers/dma/pxp/pxp_dma_v3.c

index 78583cc..289be20 100644 (file)
@@ -5223,6 +5223,15 @@ static void pxp_remove_attrs(struct platform_device *pdev)
        device_remove_file(&pdev->dev, &dev_attr_block_size);
 }
 
+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;
+}
+
 #ifdef CONFIG_MXC_FPGA_M4_TEST
 static void pxp_config_m4(struct platform_device *pdev)
 {
@@ -5313,10 +5322,7 @@ static int pxp_probe(struct platform_device *pdev)
        dump_pxp_reg(pxp);
        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;
+       pxp_init_timer(pxp);
 
        init_waitqueue_head(&pxp->thread_waitq);
        /* allocate a kernel thread to dispatch pxp conf */