aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-s3c64xx.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2015-09-03 16:40:11 -0400
committerMark Brown <broonie@kernel.org>2015-09-14 13:57:31 -0400
commit4fcd9b9e06d43b93d00bf02c767d578e7cf8b25c (patch)
treec1c0f2d28552eb2e81f81ae9da27b70656005313 /drivers/spi/spi-s3c64xx.c
parent483867ee2070e045eb0a18fb7bb2f79d2433339f (diff)
spi: s3c64xx: simplify suspend / resume handlers
The runtime PM suspend / resume handlers take care of the enabling/ disabling the clocks already. Therefore replace the duplicated clock handling with pm_runtime_force_suspend/resume. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-s3c64xx.c')
-rw-r--r--drivers/spi/spi-s3c64xx.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index d117fa638ee3..4e5931cabfa2 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1246,10 +1246,9 @@ static int s3c64xx_spi_suspend(struct device *dev)
1246 if (ret) 1246 if (ret)
1247 return ret; 1247 return ret;
1248 1248
1249 if (!pm_runtime_suspended(dev)) { 1249 ret = pm_runtime_force_suspend(dev);
1250 clk_disable_unprepare(sdd->clk); 1250 if (ret < 0)
1251 clk_disable_unprepare(sdd->src_clk); 1251 return ret;
1252 }
1253 1252
1254 sdd->cur_speed = 0; /* Output Clock is stopped */ 1253 sdd->cur_speed = 0; /* Output Clock is stopped */
1255 1254
@@ -1261,14 +1260,14 @@ static int s3c64xx_spi_resume(struct device *dev)
1261 struct spi_master *master = dev_get_drvdata(dev); 1260 struct spi_master *master = dev_get_drvdata(dev);
1262 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); 1261 struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
1263 struct s3c64xx_spi_info *sci = sdd->cntrlr_info; 1262 struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
1263 int ret;
1264 1264
1265 if (sci->cfg_gpio) 1265 if (sci->cfg_gpio)
1266 sci->cfg_gpio(); 1266 sci->cfg_gpio();
1267 1267
1268 if (!pm_runtime_suspended(dev)) { 1268 ret = pm_runtime_force_resume(dev);
1269 clk_prepare_enable(sdd->src_clk); 1269 if (ret < 0)
1270 clk_prepare_enable(sdd->clk); 1270 return ret;
1271 }
1272 1271
1273 s3c64xx_spi_hwinit(sdd, sdd->port_id); 1272 s3c64xx_spi_hwinit(sdd, sdd->port_id);
1274 1273