lkml.org 
[lkml]   [2012]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V4] PWM: Add SPEAr PWM chip driver support
From
On 24 October 2012 11:21, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> On Mon, Oct 22, 2012 at 04:36:41PM +0530, Shiraz Hashim wrote:
>> + ret = pwmchip_add(&pc->chip);
>> + if (ret < 0) {
>> + dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret);
>> + return ret;
>> + }
>> +
>> + ret = clk_prepare_enable(pc->clk);
>> + if (ret < 0)
>> + return pwmchip_remove(&pc->chip);
>
> I think in order to fix the potential race condition that Viresh
> mentioned we should move the clk_prepare_enable() before the
> pwmchip_add(), but don't forget to disable and unprepare the clock if
> pwmchip_add() fails.
>
> Actually, can't we make it a clk_prepare() only at this point and move
> the clk_enable() and clk_disable() into the if block below? In case the
> compatible value is not "st,spear1340-pwm" we don't need the clock
> enabled.

We should. I should have given this comment earlier.

--
viresh


\
 
 \ /
  Last update: 2012-10-24 09:01    [W:0.063 / U:2.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site