Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 751c925c authored by Shubhrajyoti D's avatar Shubhrajyoti D Committed by Grant Likely
Browse files

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: default avatarHebbar, Gururaja <gururaja.hebbar@ti.com>
Signed-off-by: default avatarShubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 2856ac13
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1196,6 +1196,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
err4:
	spi_master_put(master);
err3:
	pm_runtime_disable(&pdev->dev);
	kfree(mcspi->dma_channels);
err2:
	release_mem_region(r->start, resource_size(r));
@@ -1217,6 +1218,7 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
	dma_channels = mcspi->dma_channels;

	omap2_mcspi_disable_clocks(mcspi);
	pm_runtime_disable(&pdev->dev);
	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	release_mem_region(r->start, resource_size(r));