From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932881AbcFCUv2 (ORCPT ); Fri, 3 Jun 2016 16:51:28 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35852 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161079AbcFCUvV (ORCPT ); Fri, 3 Jun 2016 16:51:21 -0400 Date: Fri, 3 Jun 2016 13:51:17 -0700 From: Brian Norris To: Boris Brezillon Cc: Thierry Reding , linux-pwm@vger.kernel.org, Mark Brown , Liam Girdwood , Heiko Stuebner , linux-rockchip@lists.infradead.org, Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Milo Kim , Doug Anderson , Caesar Wang , Stephen Barber , Ajit Pal Singh , Srinivas Kandagatla , Maxime Coquelin , Patrice Chotard , kernel@stlinux.com Subject: Re: [PATCH 11/14] regulator: pwm: properly initialize the ->state field Message-ID: <20160603205117.GI124478@google.com> References: <1464942192-25967-1-git-send-email-boris.brezillon@free-electrons.com> <1464942192-25967-12-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464942192-25967-12-git-send-email-boris.brezillon@free-electrons.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 03, 2016 at 10:23:09AM +0200, Boris Brezillon wrote: > The ->state field is currently initialized to 0, thus referencing the > voltage selector at index 0, which might not reflect the current voltage > value. > If possible, retrieve the current voltage selector from the PWM state, else > return -EINVAL. > > Signed-off-by: Boris Brezillon > --- > Heiko, Mark, > > I know you already added your Tested-by/Acked-by tags on this patch > but this version has slightly change and is now making use of the > pwm_get_relative_duty_cycle() helper instead of manually converting > the absolute duty_cycle value into a relative one. > --- > drivers/regulator/pwm-regulator.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) Tested-by: Brian Norris