From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH v3 04/12] backlight: pwm_bl: remove useless call to pwm_set_period Date: Tue, 22 Sep 2015 23:12:18 +0100 Message-ID: <20150922221218.GA9317@x1> References: <1442828009-6241-1-git-send-email-boris.brezillon@free-electrons.com> <1442828009-6241-5-git-send-email-boris.brezillon@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1442828009-6241-5-git-send-email-boris.brezillon@free-electrons.com> Sender: linux-pwm-owner@vger.kernel.org To: Boris Brezillon Cc: Thierry Reding , linux-pwm@vger.kernel.org, Mark Brown , Liam Girdwood , Jingoo Han , linux-fbdev@vger.kernel.org, Bryan Wu , Richard Purdie , Jacek Anaszewski , linux-leds@vger.kernel.org, Maxime Ripard , linux-sunxi@googlegroups.com, Heiko Stuebner , linux-rockchip@lists.infradead.org, Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Daniel Mack , Haojian Zhuang , Robert Jarzmik , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Doug Anderson , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= List-Id: linux-leds@vger.kernel.org On Mon, 21 Sep 2015, Boris Brezillon wrote: > The PWM period will be set when calling pwm_config. Remove this usele= ss > call to pwm_set_period, which might mess up with the initial PWM stat= e > once we have added proper support for PWM init state retrieval. >=20 > Signed-off-by: Boris Brezillon > --- > drivers/video/backlight/pwm_bl.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) Acked-by: Lee Jones > diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlig= ht/pwm_bl.c > index ae498c1..71944f8 100644 > --- a/drivers/video/backlight/pwm_bl.c > +++ b/drivers/video/backlight/pwm_bl.c > @@ -293,12 +293,14 @@ static int pwm_backlight_probe(struct platform_= device *pdev) > * period, parsed from the DT, in the PWM device. For the non-DT ca= se, > * set the period from platform data if it has not already been set > * via the PWM lookup table. > + * FIXME: This assignment should be dropped as soon as all the boar= ds > + * have moved to the PWM lookup table approach. The same goes for t= he > + * pb->period field which should be replaced by > + * pwm_get_default_period() calls. > */ > pb->period =3D pwm_get_default_period(pb->pwm); > - if (!pb->period && (data->pwm_period_ns > 0)) { > + if (!pb->period && (data->pwm_period_ns > 0)) > pb->period =3D data->pwm_period_ns; > - pwm_set_period(pb->pwm, data->pwm_period_ns); > - } > =20 > pb->lth_brightness =3D data->lth_brightness * (pb->period / pb->sca= le); > =20 --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog