Re: [PATCH 00/10] Regulator ena_gpiod fixups

From: Charles Keepax
Date: Wed Nov 28 2018 - 10:22:49 EST


On Wed, Nov 28, 2018 at 11:43:40AM +0100, Linus Walleij wrote:
> drivers/gpio/gpiolib.h | 6 -----
> drivers/regulator/da9211-regulator.c | 4 +--
> drivers/regulator/fixed.c | 4 ++-
> drivers/regulator/lm363x-regulator.c | 8 ++++--
> drivers/regulator/lp8788-ldo.c | 4 ++-
> drivers/regulator/max77686-regulator.c | 3 +--
> drivers/regulator/max8952.c | 8 +++---
> drivers/regulator/max8973-regulator.c | 12 ++++++---
> drivers/regulator/s5m8767.c | 37 ++++++++++++++++++--------
> drivers/regulator/tps65090-regulator.c | 10 +++----
> include/linux/gpio/consumer.h | 13 +++++++++
> 11 files changed, 72 insertions(+), 37 deletions(-)

It looks like the patches are assuming the regulator core,
doesn't free the GPIO on an error, however that is not true in
all cases. If only a single regulator has requested the GPIO then
all the error paths after the call to regulator_ena_gpio_request
in regulator_register will free the GPIO. Although this is not the
case if more than one regulator has requested the GPIO.

Thanks,
charles