From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH v4 04/24] hwmon: pwm-fan: use pwm_get_xxx() helpers where appropriate Date: Mon, 16 Nov 2015 17:53:22 +0100 Message-ID: <20151116175322.48dba6f9@bbrezillon> References: <1447664207-24370-1-git-send-email-boris.brezillon@free-electrons.com> <1447664207-24370-5-git-send-email-boris.brezillon@free-electrons.com> <5649FD5B.3000208@roeck-us.net> Reply-To: boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <5649FD5B.3000208-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Guenter Roeck Cc: Thierry Reding , linux-pwm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mike Turquette , Stephen Boyd , linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mark Brown , Liam Girdwood , Kamil Debski , lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org, Jean Delvare , Dmitry Torokhov , linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Bryan Wu , Richard Purdie , Jacek Anaszewski , linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Maxime Ripard , Chen-Yu Tsai , linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Joachim Eastwood , Thomas Petazzoni , Heiko Stuebner , linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Jingoo Han , Lee Jones List-Id: linux-leds@vger.kernel.org On Mon, 16 Nov 2015 07:59:23 -0800 Guenter Roeck 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 > > update. > > > > Signed-off-by: Boris Brezillon > > --- > > Patch generated with the following coccinelle script: > > > > --->8--- > > virtual patch > > > > @@ > > struct pwm_device *p; > > expression e; > > @@ > > ( > > -(p)->polarity = e; > > +pwm_set_polarity((p), e); > > | > > -(p)->polarity > > +pwm_get_polarity((p)) > > s/((p))/(p)/ > > > | > > -(p)->period = e; > > +pwm_set_period((p), e); > > | > > -(p)->period > > +pwm_get_period((p)) > > s/((p))/(p)/ > > > | > > -(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? -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com