]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: designware: delete premature free_irq
authorJulia Lawall <Julia.Lawall@lip6.fr>
Mon, 2 Sep 2013 09:54:20 +0000 (11:54 +0200)
committerMark Brown <broonie@linaro.org>
Mon, 16 Sep 2013 23:19:14 +0000 (00:19 +0100)
Free_irq is not needed if there has been no request_irq.  Free_irq is
removed from both the probe and remove functions.  The correct request_irq
and free_irq appear to be in the add_host and remove_host functions in
spi-dw.c.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e;
@@

*e = platform_get_irq(...);
... when != request_irq(e,...)
*free_irq(e,...)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-dw-mmio.c

index 4aa8be865cc06ae81d1145161086a89c9846723e..168c620947f4b515bd3307fc84a9dcd3f06073f7 100644 (file)
@@ -74,7 +74,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
        dwsmmio->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(dwsmmio->clk)) {
                ret = PTR_ERR(dwsmmio->clk);
-               goto err_irq;
+               goto err_unmap;
        }
        clk_enable(dwsmmio->clk);
 
@@ -94,8 +94,6 @@ err_clk:
        clk_disable(dwsmmio->clk);
        clk_put(dwsmmio->clk);
        dwsmmio->clk = NULL;
-err_irq:
-       free_irq(dws->irq, dws);
 err_unmap:
        iounmap(dws->regs);
 err_release_reg:
@@ -115,7 +113,6 @@ static int dw_spi_mmio_remove(struct platform_device *pdev)
        clk_put(dwsmmio->clk);
        dwsmmio->clk = NULL;
 
-       free_irq(dwsmmio->dws.irq, &dwsmmio->dws);
        dw_spi_remove_host(&dwsmmio->dws);
        iounmap(dwsmmio->dws.regs);
        kfree(dwsmmio);