From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755076AbdL2GMi (ORCPT ); Fri, 29 Dec 2017 01:12:38 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34155 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbdL2GMh (ORCPT ); Fri, 29 Dec 2017 01:12:37 -0500 X-Google-Smtp-Source: ACJfBot+h1OvKoqILG9mdlUT9JJnSYeoz83fuu1TAGR0fKyv2S4UVJDyW1Cfog0f5EqIGrAtGryiGQ== From: Axel Lin To: Mark Brown Cc: Erick Chen , Baolin Wang , Liam Girdwood , linux-kernel@vger.kernel.org, Axel Lin Subject: [PATCH] regulator: sc2731: Fix defines for SC2731_WR_UNLOCK and SC2731_PWR_WR_PROT_VALUE Date: Fri, 29 Dec 2017 14:12:18 +0800 Message-Id: <20171229061218.14766-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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 /* * 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); } static int sc2731_regulator_probe(struct platform_device *pdev) -- 2.14.1