[21/27] spi: omap2-mcspi: use pm_runtime_last_busy_and_autosuspend helper
diff mbox

Message ID 1411575342-31048-22-git-send-email-vinod.koul@intel.com
State New, archived
Headers show

Commit Message

Vinod Koul Sept. 24, 2014, 4:15 p.m. UTC
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/spi/spi-omap2-mcspi.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

Comments

Vinod Koul Sept. 24, 2014, 4:39 p.m. UTC | #1
On Wed, Sep 24, 2014 at 05:58:55PM +0100, Mark Brown wrote:
> On Wed, Sep 24, 2014 at 09:45:11PM +0530, Vinod Koul wrote:
> > Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> > coding the same code
> 
> You haven't CCed me on anything earlier in the series so I've no idea
> what's going on here but it looks like there is probably some
> dependency?
And thats very surprsing :(

I used the Wolfram's cocci_cc script to auto cc and add everyone to cover
letter . Looks like it missed some. Sorry about that I should have been more
careful

FWIW here is cover letter https://lkml.org/lkml/2014/9/24/862

Thanks
Mark Brown Sept. 24, 2014, 4:58 p.m. UTC | #2
On Wed, Sep 24, 2014 at 09:45:11PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code

You haven't CCed me on anything earlier in the series so I've no idea
what's going on here but it looks like there is probably some
dependency?
Mark Brown Sept. 25, 2014, 1:03 p.m. UTC | #3
On Wed, Sep 24, 2014 at 09:45:11PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code

Acked-by: Mark Brown <broonie@kernel.org>

though I have to say that the function name is rather spectacularly long
here.

Patch
diff mbox

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 68441fa..fa2aae8 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1020,8 +1020,7 @@  static int omap2_mcspi_setup(struct spi_device *spi)
 		return ret;
 
 	ret = omap2_mcspi_setup_transfer(spi, NULL);
-	pm_runtime_mark_last_busy(mcspi->dev);
-	pm_runtime_put_autosuspend(mcspi->dev);
+	pm_runtime_last_busy_and_autosuspend(mcspi->dev);
 
 	return ret;
 }
@@ -1282,8 +1281,7 @@  static int omap2_mcspi_master_setup(struct omap2_mcspi *mcspi)
 	ctx->wakeupenable = OMAP2_MCSPI_WAKEUPENABLE_WKEN;
 
 	omap2_mcspi_set_master_mode(master);
-	pm_runtime_mark_last_busy(mcspi->dev);
-	pm_runtime_put_autosuspend(mcspi->dev);
+	pm_runtime_last_busy_and_autosuspend(mcspi->dev);
 	return 0;
 }
 
@@ -1504,8 +1502,7 @@  static int omap2_mcspi_resume(struct device *dev)
 			writel_relaxed(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
 		}
 	}
-	pm_runtime_mark_last_busy(mcspi->dev);
-	pm_runtime_put_autosuspend(mcspi->dev);
+	pm_runtime_last_busy_and_autosuspend(mcspi->dev);
 	return 0;
 }
 #else