Skip to content

Commit

Permalink
regulator: sc2731: Fix defines for SC2731_WR_UNLOCK and SC2731_PWR_WR…
Browse files Browse the repository at this point in the history
…_PROT_VALUE

The defines for SC2731_WR_UNLOCK and SC2731_PWR_WR_PROT_VALUE makes
regmap_write() call looks strange because it takes reg parameter fist
then val.
Base on Erick's suggestion to define SC2731_PWR_WR_PROT and
SC2731_WR_UNLOCK_VALUE instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Erick Chen <erick.chen@spreadtrum.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jan 3, 2018
1 parent 433c9bb commit fa32f7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/regulator/sc2731-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
/*
* SC2731 regulator lock register
*/
#define SC2731_PWR_WR_PROT_VALUE 0xf0c
#define SC2731_WR_UNLOCK 0x6e7f
#define SC2731_PWR_WR_PROT 0xf0c
#define SC2731_WR_UNLOCK_VALUE 0x6e7f

/*
* SC2731 enable register
Expand Down Expand Up @@ -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_PWR_WR_PROT,
SC2731_WR_UNLOCK_VALUE);
}

static int sc2731_regulator_probe(struct platform_device *pdev)
Expand Down

0 comments on commit fa32f7a

Please sign in to comment.