]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: s3c64xx: simplify suspend / resume handlers
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 3 Sep 2015 20:40:11 +0000 (22:40 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 14 Sep 2015 17:57:31 +0000 (18:57 +0100)
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>
drivers/spi/spi-s3c64xx.c

index d117fa638ee3d52ca1dc8c8c058427b8081f652e..4e5931cabfa2a53f7f3290e803b76d41b51a55a9 100644 (file)
@@ -1246,10 +1246,9 @@ static int s3c64xx_spi_suspend(struct device *dev)
        if (ret)
                return ret;
 
-       if (!pm_runtime_suspended(dev)) {
-               clk_disable_unprepare(sdd->clk);
-               clk_disable_unprepare(sdd->src_clk);
-       }
+       ret = pm_runtime_force_suspend(dev);
+       if (ret < 0)
+               return ret;
 
        sdd->cur_speed = 0; /* Output Clock is stopped */
 
@@ -1261,14 +1260,14 @@ static int s3c64xx_spi_resume(struct device *dev)
        struct spi_master *master = dev_get_drvdata(dev);
        struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
        struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
+       int ret;
 
        if (sci->cfg_gpio)
                sci->cfg_gpio();
 
-       if (!pm_runtime_suspended(dev)) {
-               clk_prepare_enable(sdd->src_clk);
-               clk_prepare_enable(sdd->clk);
-       }
+       ret = pm_runtime_force_resume(dev);
+       if (ret < 0)
+               return ret;
 
        s3c64xx_spi_hwinit(sdd, sdd->port_id);