diff mbox

[07/12] mmc: sh_mmcif: Convert to clk_prepare/unprepare

Message ID 1383000569-8916-8-git-send-email-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Oct. 28, 2013, 10:49 p.m. UTC
Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
clk_disable_unprepare() to get ready for the migration to the common
clock framework.

Cc: Chris Ball <cjb@laptop.org>
Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/mmc/host/sh_mmcif.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Guennadi Liakhovetski Oct. 29, 2013, 8:10 a.m. UTC | #1
On Mon, 28 Oct 2013, Laurent Pinchart wrote:

> Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
> clk_disable_unprepare() to get ready for the migration to the common
> clock framework.
> 
> Cc: Chris Ball <cjb@laptop.org>
> Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> Cc: linux-mmc@vger.kernel.org
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Thanks
Guennadi

> ---
>  drivers/mmc/host/sh_mmcif.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> index 36629a0..37a6c57 100644
> --- a/drivers/mmc/host/sh_mmcif.c
> +++ b/drivers/mmc/host/sh_mmcif.c
> @@ -964,7 +964,7 @@ static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  
>  static int sh_mmcif_clk_update(struct sh_mmcif_host *host)
>  {
> -	int ret = clk_enable(host->hclk);
> +	int ret = clk_prepare_enable(host->hclk);
>  
>  	if (!ret) {
>  		host->clk = clk_get_rate(host->hclk);
> @@ -1018,7 +1018,7 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  		}
>  		if (host->power) {
>  			pm_runtime_put_sync(&host->pd->dev);
> -			clk_disable(host->hclk);
> +			clk_disable_unprepare(host->hclk);
>  			host->power = false;
>  			if (ios->power_mode == MMC_POWER_OFF)
>  				sh_mmcif_set_power(host, ios);
> @@ -1466,7 +1466,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
>  
>  	mutex_init(&host->thread_lock);
>  
> -	clk_disable(host->hclk);
> +	clk_disable_unprepare(host->hclk);
>  	ret = mmc_add_host(mmc);
>  	if (ret < 0)
>  		goto emmcaddh;
> @@ -1487,7 +1487,7 @@ ereqirq1:
>  ereqirq0:
>  	pm_runtime_suspend(&pdev->dev);
>  eresume:
> -	clk_disable(host->hclk);
> +	clk_disable_unprepare(host->hclk);
>  eclkupdate:
>  	clk_put(host->hclk);
>  eclkget:
> @@ -1505,7 +1505,7 @@ static int sh_mmcif_remove(struct platform_device *pdev)
>  	int irq[2];
>  
>  	host->dying = true;
> -	clk_enable(host->hclk);
> +	clk_prepare_enable(host->hclk);
>  	pm_runtime_get_sync(&pdev->dev);
>  
>  	dev_pm_qos_hide_latency_limit(&pdev->dev);
> @@ -1530,7 +1530,7 @@ static int sh_mmcif_remove(struct platform_device *pdev)
>  	if (irq[1] >= 0)
>  		free_irq(irq[1], host);
>  
> -	clk_disable(host->hclk);
> +	clk_disable_unprepare(host->hclk);
>  	mmc_free_host(host->mmc);
>  	pm_runtime_put_sync(&pdev->dev);
>  	pm_runtime_disable(&pdev->dev);
> -- 
> 1.8.1.5
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Guennadi Liakhovetski Oct. 30, 2013, 10:23 p.m. UTC | #2
On Tue, 29 Oct 2013, Guennadi Liakhovetski wrote:

> On Mon, 28 Oct 2013, Laurent Pinchart wrote:
> 
> > Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
> > clk_disable_unprepare() to get ready for the migration to the common
> > clock framework.
> > 
> > Cc: Chris Ball <cjb@laptop.org>
> > Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> > Cc: linux-mmc@vger.kernel.org
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Sorry, I just realised, that an identical patch

http://patches.linaro.org/21212/

has been submitted prior to this one, so, we should really take the other 
one.

Thanks
Guennadi
> 
> > ---
> >  drivers/mmc/host/sh_mmcif.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
> > index 36629a0..37a6c57 100644
> > --- a/drivers/mmc/host/sh_mmcif.c
> > +++ b/drivers/mmc/host/sh_mmcif.c
> > @@ -964,7 +964,7 @@ static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
> >  
> >  static int sh_mmcif_clk_update(struct sh_mmcif_host *host)
> >  {
> > -	int ret = clk_enable(host->hclk);
> > +	int ret = clk_prepare_enable(host->hclk);
> >  
> >  	if (!ret) {
> >  		host->clk = clk_get_rate(host->hclk);
> > @@ -1018,7 +1018,7 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> >  		}
> >  		if (host->power) {
> >  			pm_runtime_put_sync(&host->pd->dev);
> > -			clk_disable(host->hclk);
> > +			clk_disable_unprepare(host->hclk);
> >  			host->power = false;
> >  			if (ios->power_mode == MMC_POWER_OFF)
> >  				sh_mmcif_set_power(host, ios);
> > @@ -1466,7 +1466,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
> >  
> >  	mutex_init(&host->thread_lock);
> >  
> > -	clk_disable(host->hclk);
> > +	clk_disable_unprepare(host->hclk);
> >  	ret = mmc_add_host(mmc);
> >  	if (ret < 0)
> >  		goto emmcaddh;
> > @@ -1487,7 +1487,7 @@ ereqirq1:
> >  ereqirq0:
> >  	pm_runtime_suspend(&pdev->dev);
> >  eresume:
> > -	clk_disable(host->hclk);
> > +	clk_disable_unprepare(host->hclk);
> >  eclkupdate:
> >  	clk_put(host->hclk);
> >  eclkget:
> > @@ -1505,7 +1505,7 @@ static int sh_mmcif_remove(struct platform_device *pdev)
> >  	int irq[2];
> >  
> >  	host->dying = true;
> > -	clk_enable(host->hclk);
> > +	clk_prepare_enable(host->hclk);
> >  	pm_runtime_get_sync(&pdev->dev);
> >  
> >  	dev_pm_qos_hide_latency_limit(&pdev->dev);
> > @@ -1530,7 +1530,7 @@ static int sh_mmcif_remove(struct platform_device *pdev)
> >  	if (irq[1] >= 0)
> >  		free_irq(irq[1], host);
> >  
> > -	clk_disable(host->hclk);
> > +	clk_disable_unprepare(host->hclk);
> >  	mmc_free_host(host->mmc);
> >  	pm_runtime_put_sync(&pdev->dev);
> >  	pm_runtime_disable(&pdev->dev);
> > -- 
> > 1.8.1.5
> > 
> 
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Laurent Pinchart Oct. 30, 2013, 11:13 p.m. UTC | #3
Hi Guennadi,

On Wednesday 30 October 2013 23:23:37 Guennadi Liakhovetski wrote:
> On Tue, 29 Oct 2013, Guennadi Liakhovetski wrote:
> > On Mon, 28 Oct 2013, Laurent Pinchart wrote:
> > > Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
> > > clk_disable_unprepare() to get ready for the migration to the common
> > > clock framework.
> > > 
> > > Cc: Chris Ball <cjb@laptop.org>
> > > Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> > > Cc: linux-mmc@vger.kernel.org
> > > Signed-off-by: Laurent Pinchart
> > > <laurent.pinchart+renesas@ideasonboard.com>
> > 
> > Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> 
> Sorry, I just realised, that an identical patch
> 
> http://patches.linaro.org/21212/
> 
> has been submitted prior to this one, so, we should really take the other
> one.

I'm fine with that, as long as one of the two patches hit mainline as soon as 
possible.
Ulf Hansson Oct. 30, 2013, 11:27 p.m. UTC | #4
On 31 October 2013 00:13, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Guennadi,
>
> On Wednesday 30 October 2013 23:23:37 Guennadi Liakhovetski wrote:
>> On Tue, 29 Oct 2013, Guennadi Liakhovetski wrote:
>> > On Mon, 28 Oct 2013, Laurent Pinchart wrote:
>> > > Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and
>> > > clk_disable_unprepare() to get ready for the migration to the common
>> > > clock framework.
>> > >
>> > > Cc: Chris Ball <cjb@laptop.org>
>> > > Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
>> > > Cc: linux-mmc@vger.kernel.org
>> > > Signed-off-by: Laurent Pinchart
>> > > <laurent.pinchart+renesas@ideasonboard.com>
>> >
>> > Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
>>
>> Sorry, I just realised, that an identical patch
>>
>> http://patches.linaro.org/21212/
>>
>> has been submitted prior to this one, so, we should really take the other
>> one.
>
> I'm fine with that, as long as one of the two patches hit mainline as soon as
> possible.

I can put together a new pull request for Chris asap, but in the end
it will be his call to take it now or later.

Kind regards
Ulf Hansson

>
> --
> Regards,
>
> Laurent Pinchart
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart Oct. 30, 2013, 11:48 p.m. UTC | #5
Hi Uluf,

On Thursday 31 October 2013 00:27:23 Ulf Hansson wrote:
> On 31 October 2013 00:13, Laurent Pinchart wrote:
> > On Wednesday 30 October 2013 23:23:37 Guennadi Liakhovetski wrote:
> >> On Tue, 29 Oct 2013, Guennadi Liakhovetski wrote:
> >> > On Mon, 28 Oct 2013, Laurent Pinchart wrote:
> >> > > Turn clk_enable() and clk_disable() calls into clk_prepare_enable()
> >> > > and clk_disable_unprepare() to get ready for the migration to the
> >> > > common clock framework.
> >> > > 
> >> > > Cc: Chris Ball <cjb@laptop.org>
> >> > > Cc: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
> >> > > Cc: linux-mmc@vger.kernel.org
> >> > > Signed-off-by: Laurent Pinchart
> >> > > <laurent.pinchart+renesas@ideasonboard.com>
> >> > 
> >> > Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> >> 
> >> Sorry, I just realised, that an identical patch
> >> 
> >> http://patches.linaro.org/21212/
> >> 
> >> has been submitted prior to this one, so, we should really take the other
> >> one.
> > 
> > I'm fine with that, as long as one of the two patches hit mainline as soon
> > as possible.
> 
> I can put together a new pull request for Chris asap, but in the end
> it will be his call to take it now or later.

That would be great. It can wait for v3.14 though, but having the patch in 
v3.13 would be nice.
diff mbox

Patch

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 36629a0..37a6c57 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -964,7 +964,7 @@  static void sh_mmcif_request(struct mmc_host *mmc, struct mmc_request *mrq)
 
 static int sh_mmcif_clk_update(struct sh_mmcif_host *host)
 {
-	int ret = clk_enable(host->hclk);
+	int ret = clk_prepare_enable(host->hclk);
 
 	if (!ret) {
 		host->clk = clk_get_rate(host->hclk);
@@ -1018,7 +1018,7 @@  static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		}
 		if (host->power) {
 			pm_runtime_put_sync(&host->pd->dev);
-			clk_disable(host->hclk);
+			clk_disable_unprepare(host->hclk);
 			host->power = false;
 			if (ios->power_mode == MMC_POWER_OFF)
 				sh_mmcif_set_power(host, ios);
@@ -1466,7 +1466,7 @@  static int sh_mmcif_probe(struct platform_device *pdev)
 
 	mutex_init(&host->thread_lock);
 
-	clk_disable(host->hclk);
+	clk_disable_unprepare(host->hclk);
 	ret = mmc_add_host(mmc);
 	if (ret < 0)
 		goto emmcaddh;
@@ -1487,7 +1487,7 @@  ereqirq1:
 ereqirq0:
 	pm_runtime_suspend(&pdev->dev);
 eresume:
-	clk_disable(host->hclk);
+	clk_disable_unprepare(host->hclk);
 eclkupdate:
 	clk_put(host->hclk);
 eclkget:
@@ -1505,7 +1505,7 @@  static int sh_mmcif_remove(struct platform_device *pdev)
 	int irq[2];
 
 	host->dying = true;
-	clk_enable(host->hclk);
+	clk_prepare_enable(host->hclk);
 	pm_runtime_get_sync(&pdev->dev);
 
 	dev_pm_qos_hide_latency_limit(&pdev->dev);
@@ -1530,7 +1530,7 @@  static int sh_mmcif_remove(struct platform_device *pdev)
 	if (irq[1] >= 0)
 		free_irq(irq[1], host);
 
-	clk_disable(host->hclk);
+	clk_disable_unprepare(host->hclk);
 	mmc_free_host(host->mmc);
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);