[PATCH v4 04/24] hwmon: pwm-fan: use pwm_get_xxx() helpers where appropriate
linux at roeck-us.net
Mon Nov 16 09:00:05 PST 2015
On 11/16/2015 08:53 AM, Boris Brezillon wrote:
> On Mon, 16 Nov 2015 07:59:23 -0800
> Guenter Roeck <linux at roeck-us.net> wrote:
>> On 11/16/2015 12:56 AM, Boris Brezillon wrote:
>>> Use pwm_get_xxx() helpers instead of directly accessing the pwm->xxx field.
>>> Doing that will ease adaptation of the PWM framework to support atomic
>>> Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
>>> Patch generated with the following coccinelle script:
>>> virtual patch
>>> struct pwm_device *p;
>>> expression e;
>>> -(p)->polarity = e;
>>> +pwm_set_polarity((p), e);
>>> -(p)->period = e;
>>> +pwm_set_period((p), e);
>>> -(p)->duty_cycle = e;
>>> +pwm_set_duty_cycle((p), e);
>> The (p) seems unnecessary here.
> I don't get this one. You mean I should drop one the parenthesis around
> p, right?
Same as above - s/(p)/p/. It should never be necessary to write
should be the same.
On the other side, I did not see this expression used in any of the patches,
though maybe I missed it.
More information about the linux-arm-kernel