Patchwork [10/15] rtc: rtc-mxc: Use clk_prepare_enable/clk_disable_unprepare

login
register
mail settings
Submitter Fabio Estevam
Date May 25, 2012, 11:14 p.m.
Message ID <1337987696-31728-10-git-send-email-festevam@gmail.com>
Download mbox | patch
Permalink /patch/161436/
State New
Headers show

Comments

Fabio Estevam - May 25, 2012, 11:14 p.m.
From: Fabio Estevam <fabio.estevam@freescale.com>

Prepare the clock before enabling it.

Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: <rtc-linux@googlegroups.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/rtc/rtc-mxc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Sascha Hauer - May 29, 2012, 9:22 a.m.
On Fri, May 25, 2012 at 08:14:51PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Prepare the clock before enabling it.
> 
> Cc: Alessandro Zummo <a.zummo@towertech.it>
> Cc: <rtc-linux@googlegroups.com>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

> ---
>  drivers/rtc/rtc-mxc.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
> index 5e1d64e..02de8b0 100644
> --- a/drivers/rtc/rtc-mxc.c
> +++ b/drivers/rtc/rtc-mxc.c
> @@ -373,7 +373,7 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
>  		goto exit_free_pdata;
>  	}
>  
> -	clk_enable(pdata->clk);
> +	clk_prepare_enable(pdata->clk);
>  	rate = clk_get_rate(pdata->clk);
>  
>  	if (rate == 32768)
> @@ -425,7 +425,7 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
>  exit_clr_drvdata:
>  	platform_set_drvdata(pdev, NULL);
>  exit_put_clk:
> -	clk_disable(pdata->clk);
> +	clk_disable_unprepare(pdata->clk);
>  	clk_put(pdata->clk);
>  
>  exit_free_pdata:
> @@ -439,7 +439,7 @@ static int __exit mxc_rtc_remove(struct platform_device *pdev)
>  
>  	rtc_device_unregister(pdata->rtc);
>  
> -	clk_disable(pdata->clk);
> +	clk_disable_unprepare(pdata->clk);
>  	clk_put(pdata->clk);
>  	platform_set_drvdata(pdev, NULL);
>  
> -- 
> 1.7.1
> 
>
Fabio Estevam - June 6, 2012, 3:43 a.m.
Alessandro/Andrew,

On Tue, May 29, 2012 at 6:22 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Fri, May 25, 2012 at 08:14:51PM -0300, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> Prepare the clock before enabling it.
>>
>> Cc: Alessandro Zummo <a.zummo@towertech.it>
>> Cc: <rtc-linux@googlegroups.com>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Can this be applied?
Fabio Estevam - Sept. 3, 2012, 9:13 p.m.
Andrew,

On Wed, Jun 6, 2012 at 12:43 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Alessandro/Andrew,
>
> On Tue, May 29, 2012 at 6:22 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>> On Fri, May 25, 2012 at 08:14:51PM -0300, Fabio Estevam wrote:
>>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>>
>>> Prepare the clock before enabling it.
>>>
>>> Cc: Alessandro Zummo <a.zummo@towertech.it>
>>> Cc: <rtc-linux@googlegroups.com>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
>
> Can this be applied?

Can you apply this one, please?

Patch

diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 5e1d64e..02de8b0 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -373,7 +373,7 @@  static int __init mxc_rtc_probe(struct platform_device *pdev)
 		goto exit_free_pdata;
 	}
 
-	clk_enable(pdata->clk);
+	clk_prepare_enable(pdata->clk);
 	rate = clk_get_rate(pdata->clk);
 
 	if (rate == 32768)
@@ -425,7 +425,7 @@  static int __init mxc_rtc_probe(struct platform_device *pdev)
 exit_clr_drvdata:
 	platform_set_drvdata(pdev, NULL);
 exit_put_clk:
-	clk_disable(pdata->clk);
+	clk_disable_unprepare(pdata->clk);
 	clk_put(pdata->clk);
 
 exit_free_pdata:
@@ -439,7 +439,7 @@  static int __exit mxc_rtc_remove(struct platform_device *pdev)
 
 	rtc_device_unregister(pdata->rtc);
 
-	clk_disable(pdata->clk);
+	clk_disable_unprepare(pdata->clk);
 	clk_put(pdata->clk);
 	platform_set_drvdata(pdev, NULL);