Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: lp8755: Use LP8755_BUCK_MAX instead of magic number

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Axel Lin and committed by
Mark Brown
1200c60b 510799ea

+3 -3
+3 -3
drivers/regulator/lp8755.c
··· 373 373 goto err_i2c; 374 374 375 375 /* sent power fault detection event to specific regulator */ 376 - for (icnt = 0; icnt < 6; icnt++) 376 + for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++) 377 377 if ((flag0 & (0x4 << icnt)) 378 378 && (pchip->irqmask & (0x04 << icnt)) 379 379 && (pchip->rdev[icnt] != NULL)) ··· 508 508 509 509 err_regulator: 510 510 /* output disable */ 511 - for (icnt = 0; icnt < 0x06; icnt++) 511 + for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++) 512 512 lp8755_write(pchip, icnt, 0x00); 513 513 514 514 return ret; ··· 522 522 for (icnt = 0; icnt < mphase_buck[pchip->mphase].nreg; icnt++) 523 523 regulator_unregister(pchip->rdev[icnt]); 524 524 525 - for (icnt = 0; icnt < 0x06; icnt++) 525 + for (icnt = 0; icnt < LP8755_BUCK_MAX; icnt++) 526 526 lp8755_write(pchip, icnt, 0x00); 527 527 528 528 if (pchip->irq != 0)