Re: [PATCH v3 06/10] pwm: Add NVIDIA Tegra SoC support |
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH v3 06/10] pwm: Add NVIDIA Tegra SoC support
- From: Ryan Mallon <rmallon@xxxxxxxxx>
- Date: Thu, 23 Feb 2012 20:25:42 +1100
- Authentication-results: mr.google.com; spf=pass (google.com: domain of rmallon@xxxxxxxxx designates 10.68.73.97 as permitted sender) smtp.mail=rmallon@xxxxxxxxx; dkim=pass header.i=rmallon@xxxxxxxxx
- Cc: devicetree-discuss@xxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-tegra@xxxxxxxxxxxxxxx, Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Matthias Kaehlcke <matthias@xxxxxxxxxxxx>, Kurt Van Dijck <kurt.van.dijck@xxxxxx>, Rob Herring <rob.herring@xxxxxxxxxxx>, Grant Likely <grant.likely@xxxxxxxxxxxx>, Colin Cross <ccross@xxxxxxxxxxx>, Olof Johansson <olof@xxxxxxxxx>, Richard Purdie <rpurdie@xxxxxxxxx>, Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, Mitch Bradley <wmb@xxxxxxxxxxxxx>, Mike Frysinger <vapier@xxxxxxxxxx>, Eric Miao <eric.y.miao@xxxxxxxxx>, Lars-Peter Clausen <lars@xxxxxxxxxx>
- In-reply-to: <20120223081459.GD8621@avionic-0098.mockup.avionic-design.de>
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19
On 23/02/12 19:14, Thierry Reding wrote:
> * Ryan Mallon wrote:
>> On 23/02/12 02:17, Thierry Reding wrote:
>>
>>> This commit adds a generic PWM framework driver for the PWFM controller
>>> found on NVIDIA Tegra SoCs. The driver is based on code from the
>>> Chromium kernel tree and was originally written by Gary King (NVIDIA)
>>> and later modified by Simon Que (Chromium).
>>>
>>> Signed-off-by: Thierry Reding <thierry.reding@xxxxxxxxxxxxxxxxx>
>>> ---
>>
>> <snip>
>>
>>> +
>>> + pwm->chip.dev = &pdev->dev;
>>> + pwm->chip.ops = &tegra_pwm_ops;
>>> + pwm->chip.base = -1;
>>> + pwm->chip.npwm = NUM_PWM;
>>
>>> +
>>> + ret = pwmchip_add(&pwm->chip);
>>
>>
>> If a driver fails to initialise the pwm_chip structure correctly it can
>> cause problems in the pwm core. For example, if the dev field doesn't
>> get set, then you will get an oops if you try to cat the pwm debugfs file.
>>
>> pwmchip_add should probably verify that the initialisation of the
>> pwm_chip structure is sane to avoid problems like this.
>
> Absolutely. What would be the best response to an invalid struct pwm_chip? I
> suppose at least returning -EINVAL, perhaps complemented with WARN_ON?
Just returning -EINVAL should be okay. I don't think you need a WARN_ON,
since failing to register the hardware should be enough of a reason for
a user to report a problem.
~Ryan
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[ARM Kernel]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]