regulator: tps65917/palmas: Simplify multiple dereference of pdata->reg_init[idx]

Converting dt to platform data logic involves picking up information
that is unique per regulator, however we can improve readability of
the code by allocating and referencing pdata->reg_init[idx] once in
the loop.

While at it, use sizeof(*pointer) when allocating pointer. This allows
for structure name changes with minimal code change.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Nishanth Menon 2016-05-05 19:29:50 -05:00 • committed by Mark Brown
commit 1b42443db6