diff options
author | Shubhrajyoti D <shubhrajyoti@ti.com> | 2011-10-28 07:44:18 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-10-29 08:07:18 -0400 |
commit | 751c925cbb3a270f9771e3945494cb44bd9e732a (patch) | |
tree | 8f50cf84164ad01af3e752ba41f90cf14256d956 /drivers/spi/spi-omap2-mcspi.c | |
parent | 2856ac13b8ab41a17b1c65e4eed51543e55f4bac (diff) |
spi/omap: call pm_runtime_disable in error path and remove
omap mcspi probe() doesnt call pm_runtime disable functions
in case of failure. remove() doesnt call pm_runtime disable. This could
lead to warnings as below on subsequent insmod.
~# insmod spi-omap2-mcspi.ko
[ 255.383671] omap2_mcspi omap2_mcspi.1: Unbalanced pm_runtime_enable!
...
This patch adds the pm_runtime disable() at appropriate stages.
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi-omap2-mcspi.c')
-rw-r--r-- | drivers/spi/spi-omap2-mcspi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 0192d1b79ca7..22e17264a20e 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c | |||
@@ -1196,6 +1196,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) | |||
1196 | err4: | 1196 | err4: |
1197 | spi_master_put(master); | 1197 | spi_master_put(master); |
1198 | err3: | 1198 | err3: |
1199 | pm_runtime_disable(&pdev->dev); | ||
1199 | kfree(mcspi->dma_channels); | 1200 | kfree(mcspi->dma_channels); |
1200 | err2: | 1201 | err2: |
1201 | release_mem_region(r->start, resource_size(r)); | 1202 | release_mem_region(r->start, resource_size(r)); |
@@ -1217,6 +1218,7 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev) | |||
1217 | dma_channels = mcspi->dma_channels; | 1218 | dma_channels = mcspi->dma_channels; |
1218 | 1219 | ||
1219 | omap2_mcspi_disable_clocks(mcspi); | 1220 | omap2_mcspi_disable_clocks(mcspi); |
1221 | pm_runtime_disable(&pdev->dev); | ||
1220 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1222 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1221 | release_mem_region(r->start, resource_size(r)); | 1223 | release_mem_region(r->start, resource_size(r)); |
1222 | 1224 | ||