Commit 4fcd9b9e authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Mark Brown
Browse files

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 483867ee
Loading
Loading
Loading
Loading
+7 −8
Original line number Original line Diff line number Diff line
@@ -1246,10 +1246,9 @@ static int s3c64xx_spi_suspend(struct device *dev)
	if (ret)
	if (ret)
		return ret;
		return ret;


	if (!pm_runtime_suspended(dev)) {
	ret = pm_runtime_force_suspend(dev);
		clk_disable_unprepare(sdd->clk);
	if (ret < 0)
		clk_disable_unprepare(sdd->src_clk);
		return ret;
	}


	sdd->cur_speed = 0; /* Output Clock is stopped */
	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 spi_master *master = dev_get_drvdata(dev);
	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
	struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
	struct s3c64xx_spi_info *sci = sdd->cntrlr_info;
	int ret;


	if (sci->cfg_gpio)
	if (sci->cfg_gpio)
		sci->cfg_gpio();
		sci->cfg_gpio();


	if (!pm_runtime_suspended(dev)) {
	ret = pm_runtime_force_resume(dev);
		clk_prepare_enable(sdd->src_clk);
	if (ret < 0)
		clk_prepare_enable(sdd->clk);
		return ret;
	}


	s3c64xx_spi_hwinit(sdd, sdd->port_id);
	s3c64xx_spi_hwinit(sdd, sdd->port_id);