From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751068AbeAAGWg (ORCPT + 1 other); Mon, 1 Jan 2018 01:22:36 -0500 Received: from sci-ig2.spreadtrum.com ([222.66.158.135]:11326 "EHLO SHSQR01.spreadtrum.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750748AbeAAGWf (ORCPT ); Mon, 1 Jan 2018 01:22:35 -0500 Date: Mon, 1 Jan 2018 14:14:05 +0800 From: Erick Chen To: Axel Lin CC: Mark Brown , Baolin Wang , Liam Girdwood , Subject: Re: [PATCH] regulator: sc2731: Fix defines for SC2731_WR_UNLOCK and SC2731_PWR_WR_PROT_VALUE Message-ID: <20180101061404.GA29748@spreadtrum.com> References: <20171229061218.14766-1-axel.lin@ingics.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171229061218.14766-1-axel.lin@ingics.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-MAIL: SHSQR01.spreadtrum.com w016Ke8W067237 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Axel, O 五, 12月 29, 2017 at 02:12:18下午 +0800, Axel Lin wrote: > The define for SC2731_WR_UNLOCK and SC2731_PWR_WR_PROT_VALUE are > swapped, so the code calling regmap_write() looks strange. Fix it. > regmap_write takes reg parameter first then val. > > Signed-off-by: Axel Lin > --- > Hi Erick, > I don't have the datasheet. Can you check this? These definitions are following our datasheet's naming rule, may seem puzzling. And your patch could be better, my suggestions are as follows. Thanks, > Thanks, > Axel > drivers/regulator/sc2731-regulator.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/regulator/sc2731-regulator.c b/drivers/regulator/sc2731-regulator.c > index 794fcd504b3d..7f2b137bb98a 100644 > --- a/drivers/regulator/sc2731-regulator.c > +++ b/drivers/regulator/sc2731-regulator.c > @@ -13,8 +13,8 @@ > /* > * SC2731 regulator lock register > */ > -#define SC2731_PWR_WR_PROT_VALUE 0xf0c > -#define SC2731_WR_UNLOCK 0x6e7f > +#define SC2731_WR_UNLOCK 0xf0c > +#define SC2731_PWR_WR_PROT_VALUE 0x6e7f #define SC2731_PWR_WR_PROT 0xf0c #define SC2731_WR_UNLOCK_VALUE 0x6e7f > /* > * SC2731 enable register > @@ -203,8 +203,8 @@ static struct regulator_desc regulators[] = { > > static int sc2731_regulator_unlock(struct regmap *regmap) > { > - return regmap_write(regmap, SC2731_PWR_WR_PROT_VALUE, > - SC2731_WR_UNLOCK); > + return regmap_write(regmap, SC2731_WR_UNLOCK, > + SC2731_PWR_WR_PROT_VALUE); return regmap_write(regmap, SC2731_PWR_WR_PROT, SC2731_WR_UNLOCK_VALUE); > } > > static int sc2731_regulator_probe(struct platform_device *pdev) > -- > 2.14.1 >