Re: [PATCH v3 3/3] rtc: omap: Add external clock enabling support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 18, 2015 at 11:48:44AM +0530, Keerthy wrote:
> Configure the clock source to external clock if available.
> External clock is preferred as it can be ticking during suspend.
> 
> Signed-off-by: Keerthy <j-keerthy@xxxxxx>
> ---
>  drivers/rtc/rtc-omap.c | 33 ++++++++++++++++++++++++++++++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index f31c012..255f7b7 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
 
> @@ -555,11 +557,19 @@ static int omap_rtc_probe(struct platform_device *pdev)
>  	if (rtc->irq_alarm <= 0)
>  		return -ENOENT;
>  
> -	rtc->clk = devm_clk_get(&pdev->dev, "int-clk");
> -
> -	if (!IS_ERR(rtc->clk))
> +	rtc->clk = devm_clk_get(&pdev->dev, "ext-clk");
> +	if (!IS_ERR(rtc->clk)) {
> +		rtc->has_ext_clk = true;
>  		clk_prepare_enable(rtc->clk);
> +	} else {
> +		rtc->clk = devm_clk_get(&pdev->dev, "int-clk");
> +		if (IS_ERR(rtc->clk))
> +			goto no_clk;
> +	}
>
> +	clk_prepare_enable(rtc->clk);

Just always check for errors before enabling here, and get rid of the
double enable and goto above.

> +
> +no_clk:

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux