Re: [PATCH 14/15] watchdog/mpcore_wdt: Add clock framework support

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

 



On Wed, Mar 07, 2012 at 04:20:58AM -0800, viresh kumar wrote:
> On 3/7/12, Russell King - ARM Linux <linux@xxxxxxxxxxxxxxxx> wrote:
> > On Wed, Mar 07, 2012 at 03:57:55PM +0530, Viresh Kumar wrote:
> >> @@ -156,10 +159,22 @@ static int mpcore_wdt_open(struct inode *inode,
> >> struct file *file)
> 
> >> +		ret = clk_enable(wdt->clk);
> >
> > What about preparing the clock?
> >
> 
> I missed that. Will update prepare/unprepare of clk across driver.
> 
> >> +	wdt->clk = clk_get(&pdev->dev, NULL);
> >> +	if (IS_ERR(wdt->clk)) {
> >> +		dev_warn(&pdev->dev, "Clock not found\n");
> >> +		wdt->clk = NULL;
> >
> > Remove this line.
> 
> Actually this was very much intentional, so that i can do
>     if (wdt->clk).

Drivers have no business interpreting anything but an IS_ERR() return from
clk_get() as invalid.  Everything else is the CLK APIs business, not the
driver's business.  So, to start using NULL as a special case is wrong.

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" 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 Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux