Commit 1200c60b authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: lp8755: Use LP8755_BUCK_MAX instead of magic number

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 510799ea
...@@ -373,7 +373,7 @@ static irqreturn_t lp8755_irq_handler(int irq, void *data) ...@@ -373,7 +373,7 @@ static irqreturn_t lp8755_irq_handler(int irq, void *data)
goto err_i2c; goto err_i2c;
/* sent power fault detection event to specific regulator */ /* 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)) if ((flag0 & (0x4 << icnt))
&& (pchip->irqmask & (0x04 << icnt)) && (pchip->irqmask & (0x04 << icnt))
&& (pchip->rdev[icnt] != NULL)) && (pchip->rdev[icnt] != NULL))
...@@ -508,7 +508,7 @@ static int lp8755_probe(struct i2c_client *client, ...@@ -508,7 +508,7 @@ static int lp8755_probe(struct i2c_client *client,
err_regulator: err_regulator:
/* output disable */ /* output disable */
for (icnt = 0; icnt < 0x06; icnt++) for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
lp8755_write(pchip, icnt, 0x00); lp8755_write(pchip, icnt, 0x00);
return ret; return ret;
...@@ -522,7 +522,7 @@ static int lp8755_remove(struct i2c_client *client) ...@@ -522,7 +522,7 @@ static int lp8755_remove(struct i2c_client *client)
for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++)
regulator_unregister(pchip->rdev[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); lp8755_write(pchip, icnt, 0x00);
if (pchip->irq != 0) if (pchip->irq != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment