diff mbox

[6/6] spi: st-ssc4: Remove 'no clocking' hack

Message ID 20160607111930.10375-7-lee.jones@linaro.org (mailing list archive)
State Not Applicable, archived
Delegated to: Stephen Boyd
Headers show

Commit Message

Lee Jones June 7, 2016, 11:19 a.m. UTC
Due to the newly upstreamed 'critical clocks' API we can now
safely handle clocking in the SPI and I2C drivers without fear
of catastrophically crippling the running platform.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/spi/spi-st-ssc4.c | 36 +++++-------------------------------
 1 file changed, 5 insertions(+), 31 deletions(-)

Comments

Mark Brown June 7, 2016, 3:17 p.m. UTC | #1
On Tue, Jun 07, 2016 at 12:19:30PM +0100, Lee Jones wrote:
> Due to the newly upstreamed 'critical clocks' API we can now
> safely handle clocking in the SPI and I2C drivers without fear
> of catastrophically crippling the running platform.

Acked-by: Mark Brown <broonie@kernel.org>
Lee Jones June 30, 2016, 8:52 p.m. UTC | #2
On Tue, 07 Jun 2016, Mark Brown wrote:
> On Tue, Jun 07, 2016 at 12:19:30PM +0100, Lee Jones wrote:
> > Due to the newly upstreamed 'critical clocks' API we can now
> > safely handle clocking in the SPI and I2C drivers without fear
> > of catastrophically crippling the running platform.
> 
> Acked-by: Mark Brown <broonie@kernel.org>

We really need to guarantee that this goes in *after* the other
patches have landed, and it looks like they're heading in via their
own respective trees.  Any chance you can hold this back and submit it
via your v4.8-fixes submission?
Mark Brown July 1, 2016, 9:59 a.m. UTC | #3
On Thu, Jun 30, 2016 at 09:52:15PM +0100, Lee Jones wrote:
> On Tue, 07 Jun 2016, Mark Brown wrote:
> > On Tue, Jun 07, 2016 at 12:19:30PM +0100, Lee Jones wrote:
> > > Due to the newly upstreamed 'critical clocks' API we can now
> > > safely handle clocking in the SPI and I2C drivers without fear
> > > of catastrophically crippling the running platform.

> > Acked-by: Mark Brown <broonie@kernel.org>

> We really need to guarantee that this goes in *after* the other
> patches have landed, and it looks like they're heading in via their
> own respective trees.  Any chance you can hold this back and submit it
> via your v4.8-fixes submission?

I've not applied this patch and had no intention of applying it, the
whole point in me acking it was that I was expecting it to get applied
as part of the series since AFAICT everything needed to go in together.
Your pattern of acking patches you're expecting to be apply yourself is
fairly unusual, if it's someone else it's generally safe to assume
they're expecting the patch to go via another tree.

If this still needs sorting after the merge window please resend it, or
ideally it can go in along with the rest of the series via whatever path
that's taking.
diff mbox

Patch

diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c
index d5adf9f..a56eca0 100644
--- a/drivers/spi/spi-st-ssc4.c
+++ b/drivers/spi/spi-st-ssc4.c
@@ -68,32 +68,6 @@  struct spi_st {
 	struct completion	done;
 };
 
-static int spi_st_clk_enable(struct spi_st *spi_st)
-{
-	/*
-	 * Current platforms use one of the core clocks for SPI and I2C.
-	 * If we attempt to disable the clock, the system will hang.
-	 *
-	 * TODO: Remove this when platform supports power domains.
-	 */
-	return 0;
-
-	return clk_prepare_enable(spi_st->clk);
-}
-
-static void spi_st_clk_disable(struct spi_st *spi_st)
-{
-	/*
-	 * Current platforms use one of the core clocks for SPI and I2C.
-	 * If we attempt to disable the clock, the system will hang.
-	 *
-	 * TODO: Remove this when platform supports power domains.
-	 */
-	return;
-
-	clk_disable_unprepare(spi_st->clk);
-}
-
 /* Load the TX FIFO */
 static void ssc_write_tx_fifo(struct spi_st *spi_st)
 {
@@ -349,7 +323,7 @@  static int spi_st_probe(struct platform_device *pdev)
 		goto put_master;
 	}
 
-	ret = spi_st_clk_enable(spi_st);
+	ret = clk_prepare_enable(spi_st->clk);
 	if (ret)
 		goto put_master;
 
@@ -408,7 +382,7 @@  static int spi_st_probe(struct platform_device *pdev)
 	return 0;
 
 clk_disable:
-	spi_st_clk_disable(spi_st);
+	clk_disable_unprepare(spi_st->clk);
 put_master:
 	spi_master_put(master);
 	return ret;
@@ -419,7 +393,7 @@  static int spi_st_remove(struct platform_device *pdev)
 	struct spi_master *master = platform_get_drvdata(pdev);
 	struct spi_st *spi_st = spi_master_get_devdata(master);
 
-	spi_st_clk_disable(spi_st);
+	clk_disable_unprepare(spi_st->clk);
 
 	pinctrl_pm_select_sleep_state(&pdev->dev);
 
@@ -435,7 +409,7 @@  static int spi_st_runtime_suspend(struct device *dev)
 	writel_relaxed(0, spi_st->base + SSC_IEN);
 	pinctrl_pm_select_sleep_state(dev);
 
-	spi_st_clk_disable(spi_st);
+	clk_disable_unprepare(spi_st->clk);
 
 	return 0;
 }
@@ -446,7 +420,7 @@  static int spi_st_runtime_resume(struct device *dev)
 	struct spi_st *spi_st = spi_master_get_devdata(master);
 	int ret;
 
-	ret = spi_st_clk_enable(spi_st);
+	ret = clk_prepare_enable(spi_st->clk);
 	pinctrl_pm_select_default_state(dev);
 
 	return ret;