All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 V2] mtd: spear_smi: Add clk_{un}prepare() support
@ 2012-04-17 11:37 Viresh Kumar
  2012-04-17 11:37 ` [PATCH 2/2 V2] mtd: fsmc_nand: " Viresh Kumar
  2012-04-26  6:20 ` [PATCH 1/2 V2] mtd: spear_smi: " Artem Bityutskiy
  0 siblings, 2 replies; 4+ messages in thread
From: Viresh Kumar @ 2012-04-17 11:37 UTC (permalink / raw)
  To: dwmw2, artem.bityutskiy
  Cc: Viresh Kumar, linus.walleij, spear-devel, linux-mtd, viresh.linux, sr

clk_{un}prepare is mandatory for platforms using common clock framework. Since
this driver is used by SPEAr platform, which supports common clock framework,
add clk_{un}prepare() support for it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
V1->V2:
- Use clk_prepare_enable and clk_disable_unprepare

 drivers/mtd/devices/spear_smi.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index 797d43c..6796036 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -990,9 +990,9 @@ static int __devinit spear_smi_probe(struct platform_device *pdev)
 		goto err_clk;
 	}
 
-	ret = clk_enable(dev->clk);
+	ret = clk_prepare_enable(dev->clk);
 	if (ret)
-		goto err_clk_enable;
+		goto err_clk_prepare_enable;
 
 	ret = request_irq(irq, spear_smi_int_handler, 0, pdev->name, dev);
 	if (ret) {
@@ -1020,8 +1020,8 @@ err_bank_setup:
 	free_irq(irq, dev);
 	platform_set_drvdata(pdev, NULL);
 err_irq:
-	clk_disable(dev->clk);
-err_clk_enable:
+	clk_disable_unprepare(dev->clk);
+err_clk_prepare_enable:
 	clk_put(dev->clk);
 err_clk:
 	iounmap(dev->io_base);
@@ -1074,7 +1074,7 @@ static int __devexit spear_smi_remove(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	free_irq(irq, dev);
 
-	clk_disable(dev->clk);
+	clk_disable_unprepare(dev->clk);
 	clk_put(dev->clk);
 	iounmap(dev->io_base);
 	kfree(dev);
@@ -1091,7 +1091,7 @@ int spear_smi_suspend(struct platform_device *pdev, pm_message_t state)
 	struct spear_smi *dev = platform_get_drvdata(pdev);
 
 	if (dev && dev->clk)
-		clk_disable(dev->clk);
+		clk_disable_unprepare(dev->clk);
 
 	return 0;
 }
@@ -1102,7 +1102,7 @@ int spear_smi_resume(struct platform_device *pdev)
 	int ret = -EPERM;
 
 	if (dev && dev->clk)
-		ret = clk_enable(dev->clk);
+		ret = clk_prepare_enable(dev->clk);
 
 	if (!ret)
 		spear_smi_hw_init(dev);
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2 V2] mtd: fsmc_nand: Add clk_{un}prepare() support
  2012-04-17 11:37 [PATCH 1/2 V2] mtd: spear_smi: Add clk_{un}prepare() support Viresh Kumar
@ 2012-04-17 11:37 ` Viresh Kumar
  2012-04-17 18:21   ` Linus Walleij
  2012-04-26  6:20 ` [PATCH 1/2 V2] mtd: spear_smi: " Artem Bityutskiy
  1 sibling, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2012-04-17 11:37 UTC (permalink / raw)
  To: dwmw2, artem.bityutskiy
  Cc: Viresh Kumar, linus.walleij, spear-devel, linux-mtd, viresh.linux, sr

clk_{un}prepare is mandatory for platforms using common clock framework. Since
this driver is used by SPEAr platform, which supports common clock framework,
add clk_{un}prepare() support for it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
V1->V2:
- Use clk_prepare_enable and clk_disable_unprepare

 drivers/mtd/nand/fsmc_nand.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 1b8330e..9d7f417 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -994,9 +994,9 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 		return PTR_ERR(host->clk);
 	}
 
-	ret = clk_enable(host->clk);
+	ret = clk_prepare_enable(host->clk);
 	if (ret)
-		goto err_clk_enable;
+		goto err_clk_prepare_enable;
 
 	/*
 	 * This device ID is actually a common AMBA ID as used on the
@@ -1176,8 +1176,8 @@ err_req_write_chnl:
 	if (host->mode == USE_DMA_ACCESS)
 		dma_release_channel(host->read_dma_chan);
 err_req_read_chnl:
-	clk_disable(host->clk);
-err_clk_enable:
+	clk_disable_unprepare(host->clk);
+err_clk_prepare_enable:
 	clk_put(host->clk);
 	return ret;
 }
@@ -1198,7 +1198,7 @@ static int fsmc_nand_remove(struct platform_device *pdev)
 			dma_release_channel(host->write_dma_chan);
 			dma_release_channel(host->read_dma_chan);
 		}
-		clk_disable(host->clk);
+		clk_disable_unprepare(host->clk);
 		clk_put(host->clk);
 	}
 
@@ -1210,7 +1210,7 @@ static int fsmc_nand_suspend(struct device *dev)
 {
 	struct fsmc_nand_data *host = dev_get_drvdata(dev);
 	if (host)
-		clk_disable(host->clk);
+		clk_disable_unprepare(host->clk);
 	return 0;
 }
 
@@ -1218,7 +1218,7 @@ static int fsmc_nand_resume(struct device *dev)
 {
 	struct fsmc_nand_data *host = dev_get_drvdata(dev);
 	if (host) {
-		clk_enable(host->clk);
+		clk_prepare_enable(host->clk);
 		fsmc_nand_setup(host->regs_va, host->bank,
 				host->nand.options & NAND_BUSWIDTH_16,
 				host->dev_timings);
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2 V2] mtd: fsmc_nand: Add clk_{un}prepare() support
  2012-04-17 11:37 ` [PATCH 2/2 V2] mtd: fsmc_nand: " Viresh Kumar
@ 2012-04-17 18:21   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-04-17 18:21 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: artem.bityutskiy, spear-devel, viresh.linux, linux-mtd, sr, dwmw2

On Tue, Apr 17, 2012 at 1:37 PM, Viresh Kumar <viresh.kumar@st.com> wrote:

> clk_{un}prepare is mandatory for platforms using common clock framework. Since
> this driver is used by SPEAr platform, which supports common clock framework,
> add clk_{un}prepare() support for it.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
> ---
> V1->V2:
> - Use clk_prepare_enable and clk_disable_unprepare

Even smarter.
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2 V2] mtd: spear_smi: Add clk_{un}prepare() support
  2012-04-17 11:37 [PATCH 1/2 V2] mtd: spear_smi: Add clk_{un}prepare() support Viresh Kumar
  2012-04-17 11:37 ` [PATCH 2/2 V2] mtd: fsmc_nand: " Viresh Kumar
@ 2012-04-26  6:20 ` Artem Bityutskiy
  1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-04-26  6:20 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: artem.bityutskiy, linus.walleij, spear-devel, viresh.linux,
	linux-mtd, sr, dwmw2

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

On Tue, 2012-04-17 at 17:07 +0530, Viresh Kumar wrote:
> clk_{un}prepare is mandatory for platforms using common clock framework. Since
> this driver is used by SPEAr platform, which supports common clock framework,
> add clk_{un}prepare() support for it.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>

Pushed to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-26  6:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-17 11:37 [PATCH 1/2 V2] mtd: spear_smi: Add clk_{un}prepare() support Viresh Kumar
2012-04-17 11:37 ` [PATCH 2/2 V2] mtd: fsmc_nand: " Viresh Kumar
2012-04-17 18:21   ` Linus Walleij
2012-04-26  6:20 ` [PATCH 1/2 V2] mtd: spear_smi: " Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.