From b426ea53fbdd902e85eacb865d1b2912b49260fe Mon Sep 17 00:00:00 2001 From: Johnny Qiu Date: Mon, 18 Jun 2012 15:11:23 +0800 Subject: spi: tegra: do not start transfer if runtime pm fails to resume Bug 995706 During device shutdown/rebooting, runtime PM is disabled. SPI bus driver will fail to call tegra_spi_runtime_resume() to resume the clock needed by tranferring. In this case, do not start transferring. Change-Id: I42cc0763f55b6c90df00fbad68794939e903199a Signed-off-by: Johnny Qiu Reviewed-on: http://git-master/r/109458 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan --- drivers/spi/spi-tegra.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index d4b9c3344eee..33e2004101b7 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c @@ -736,7 +736,12 @@ static void spi_tegra_start_transfer(struct spi_device *spi, command2 = tspi->def_command2_reg; if (is_first_of_msg) { - pm_runtime_get_sync(&tspi->pdev->dev); + if ((ret = pm_runtime_get_sync(&tspi->pdev->dev)) < 0) { + dev_err(&tspi->pdev->dev, + "%s: pm_runtime_get_sync() returns %d\n", + __func__, ret); + return; + } spi_tegra_clear_status(tspi); -- cgit v1.2.3