diff options
author | Leilk Liu <leilk.liu@mediatek.com> | 2015-08-24 05:45:17 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-08-25 19:48:23 +0200 |
commit | 13da5a0b72ea66c74483966ff91718ae0a9c0703 (patch) | |
tree | a314a4d23c8dc38270364ff1121807857ab8fd99 /drivers/spi/spi-mt65xx.c | |
parent | spi: mediatek: replace int with u32, delete TAB and define MTK_SPI_PAUSE_INT_... (diff) | |
download | linux-13da5a0b72ea66c74483966ff91718ae0a9c0703.tar.xz linux-13da5a0b72ea66c74483966ff91718ae0a9c0703.zip |
spi: mediatek: add PM clk_prepare_enable fail flow
This patch adds PM clk_prepare_enable fail flow.
Signed-off-by: Leilk Liu <leilk.liu@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-mt65xx.c')
-rw-r--r-- | drivers/spi/spi-mt65xx.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c index 81b75b94145c..14112a5e63b9 100644 --- a/drivers/spi/spi-mt65xx.c +++ b/drivers/spi/spi-mt65xx.c @@ -665,8 +665,10 @@ static int mtk_spi_resume(struct device *dev) if (!pm_runtime_suspended(dev)) { ret = clk_prepare_enable(mdata->spi_clk); - if (ret < 0) + if (ret < 0) { + dev_err(dev, "failed to enable spi_clk (%d)\n", ret); return ret; + } } ret = spi_master_resume(master); @@ -692,8 +694,15 @@ static int mtk_spi_runtime_resume(struct device *dev) { struct spi_master *master = dev_get_drvdata(dev); struct mtk_spi *mdata = spi_master_get_devdata(master); + int ret; + + ret = clk_prepare_enable(mdata->spi_clk); + if (ret < 0) { + dev_err(dev, "failed to enable spi_clk (%d)\n", ret); + return ret; + } - return clk_prepare_enable(mdata->spi_clk); + return 0; } #endif /* CONFIG_PM */ |