Skip to contentSkip to conversation

regulator: lp8755: Use LP8755_BUCK_MAX instead of magic number

PATCH Applied Axel Lin 3 participants 3 messages Jan 26, 2013 – Jan 27, 2013 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: lp8755: Use LP8755_BUCK_MAX instead of magic number

---
 drivers/regulator/lp8755.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/lp8755.c +3 -3
index 8b1ce0f..f0f6ea0 100644
@@ -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))
@@ -508,7 +508,7 @@ err_irq:
 
 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;
@@ -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)
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 41 lines · Axel Lin

---
drivers/regulator/lp8755.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/lp8755.c +1 -1
index 8b1ce0f..f0f6ea0 100644
@@ -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))
@@ -508,7 +508,7 @@ err_irq:
 

err_regulator:

	/* output disable */
drivers/regulator/lp8755.c +1 -1
-	for (icnt = 0; icnt < 0x06; icnt++)
+	for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++)
		lp8755_write(pchip, icnt, 0x00);

	return ret;
drivers/regulator/lp8755.c +1 -1
@@ -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)
Signature · 1 line
1.7.9.5

Yes you're right!
Thank you Axel.
Daniel.