diff options
author | Chen-Yu Tsai <wens@csie.org> | 2019-01-13 12:57:22 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-01-14 18:09:27 +0300 |
commit | dc14455841773df52b15a17b36d01a26745f212b (patch) | |
tree | 81a10c9d247a61d571a080b0504dd46d532d24fe /drivers/pinctrl/sunxi/pinctrl-sunxi.h | |
parent | 2d2d478576d71000b29c52668c5712c825ee9af8 (diff) | |
download | linux-dc14455841773df52b15a17b36d01a26745f212b.tar.xz |
pinctrl: sunxi: Fix and simplify pin bank regulator handling
The new per-pin-bank regulator handling code in the sunxi pinctrl driver
has mismatched conditions for enabling and disabling the regulator: it
is enabled each time a pin is requested, but only disabled when the
pin-bank's reference count reaches zero.
Since we are doing reference counting already, there's no need to enable
the regulator each time a pin is requested. Instead we can just do it
for the first requested pin of each pin-bank. Thus we can reverse the
test and bail out early if it's not the first occurrence.
Fixes: 9a2a566adb00 ("pinctrl: sunxi: Deal with per-bank regulators")
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/sunxi/pinctrl-sunxi.h')
0 files changed, 0 insertions, 0 deletions