Messages in this thread Patch in this message | | | From | Axel Lin <> | Subject | [RESEND][PATCH 1/2] regulator: da9062: Simplify the code iterating all regulators | Date | Mon, 7 Oct 2019 19:50:08 +0800 |
| |
It's more straightforward to use for statement here.
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Steve Twiss <stwiss.opensource@diasemi.com> --- This was sent on https://lkml.org/lkml/2019/7/11/208 with Adam's Ack. drivers/regulator/da9062-regulator.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/regulator/da9062-regulator.c b/drivers/regulator/da9062-regulator.c index 710e67081d53..9bb895006455 100644 --- a/drivers/regulator/da9062-regulator.c +++ b/drivers/regulator/da9062-regulator.c @@ -942,8 +942,7 @@ static int da9062_regulator_probe(struct platform_device *pdev) regulators->n_regulators = max_regulators; platform_set_drvdata(pdev, regulators); - n = 0; - while (n < regulators->n_regulators) { + for (n = 0; n < regulators->n_regulators; n++) { /* Initialise regulator structure */ regl = ®ulators->regulator[n]; regl->hw = chip; @@ -1002,8 +1001,6 @@ static int da9062_regulator_probe(struct platform_device *pdev) regl->desc.name); return PTR_ERR(regl->rdev); } - - n++; } /* LDOs overcurrent event support */ -- 2.20.1
| |