OSDN Git Service

pinctrl: renesas: checker: Rework drive and bias pin iteration
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 19 Apr 2022 08:08:32 +0000 (10:08 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 20 Apr 2022 09:53:46 +0000 (11:53 +0200)
commitdd035683fd1099729bb284cba967c8ee4a0cd64d
tree9ee53e733d7e8ccecd80e96bb9f3a4fd590a20e6
parent74273035c7e486fa046ee7f80fbdb9c19169ef19
pinctrl: renesas: checker: Rework drive and bias pin iteration

The checker code to iterate over all drive strength and bias register
description items is cumbersome, due to the repeated calculation of
indices, and the use of hardcoded array sizes.  The latter was done
under the assumption they would never need to be changed, which turned
out to be false.

Increase readability by introducing helper macros to access drive
strength and bias register description items.
Increase maintainability by replacing hardcoded numbers by array sizes
calculated at compile-time.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/5051ae56a1388ccf2d283dfc9624de2991cce914.1650355619.git.geert+renesas@glider.be
drivers/pinctrl/renesas/core.c