Skip to content

Commit

Permalink
regulator: lp8755: Use LP8755_BUCK_MAX instead of magic number
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jan 27, 2013
1 parent 510799e commit 1200c60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/regulator/lp8755.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ static irqreturn_t lp8755_irq_handler(int irq, void *data)
goto err_i2c;

/* sent power fault detection event to specific regulator */
for (icnt = 0; icnt < 6; icnt++)
for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
if ((flag0 & (0x4 << icnt))
&& (pchip->irqmask & (0x04 << icnt))
&& (pchip->rdev[icnt] != NULL))
Expand Down Expand Up @@ -508,7 +508,7 @@ static int lp8755_probe(struct i2c_client *client,

err_regulator:
/* output disable */
for (icnt = 0; icnt < 0x06; icnt++)
for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
lp8755_write(pchip, icnt, 0x00);

return ret;
Expand All @@ -522,7 +522,7 @@ static int lp8755_remove(struct i2c_client *client)
for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++)
regulator_unregister(pchip->rdev[icnt]);

for (icnt = 0; icnt < 0x06; icnt++)
for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
lp8755_write(pchip, icnt, 0x00);

if (pchip->irq != 0)
Expand Down

0 comments on commit 1200c60

Please sign in to comment.