[PATCH 6/7] rtc: sa1100: enable clk support
Russell King - ARM Linux
linux at arm.linux.org.uk
Thu Feb 23 05:34:59 EST 2012
On Tue, Feb 21, 2012 at 05:04:55PM +0800, Haojian Zhuang wrote:
> @@ -306,6 +308,13 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
> if (!info)
> return -ENOMEM;
>
> + info->clk = clk_get(&pdev->dev, NULL);
> + if (IS_ERR(info->clk)) {
> + dev_err(&pdev->dev, "failed to find rtc clock source\n");
> + ret = PTR_ERR(info->clk);
> + goto err_clk;
> + }
> + clk_prepare_enable(info->clk);
What about checking for errors from clk_prepare_enable() ?
I assume that this is the clock required to access the peripheral, rather
than the timekeeping clock? If so, does it need to be kept enabled all
the time the driver is probed, or can the clock be prepared & enabled and
disabled & unprepared when the device is opened/closed ?
More information about the linux-arm-kernel
mailing list