summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-02-21 21:28:46 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-06 14:48:44 +0000
commit9c7c16109b71c59d5dfc7df2d2b706dfd7c81f86 (patch)
tree5a2ccd4ff7a5419de9a5f45e2aa07fb4b545abf4 /drivers
parent92515c4ef1b462136f09769ce31106481ce1b4d6 (diff)
downloadlinux-stable-9c7c16109b71c59d5dfc7df2d2b706dfd7c81f86.tar.gz
linux-stable-9c7c16109b71c59d5dfc7df2d2b706dfd7c81f86.tar.bz2
linux-stable-9c7c16109b71c59d5dfc7df2d2b706dfd7c81f86.zip
gpiolib: Fix the error path order in gpiochip_add_data_with_key()
[ Upstream commit e4aec4daa8c009057b5e063db1b7322252c92dc8 ] After shuffling the code, error path wasn't updated correctly. Fix it here. Fixes: 2f4133bb5f14 ("gpiolib: No need to call gpiochip_remove_pin_ranges() twice") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpiolib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 71492d213ef4..53ab4e62503f 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -925,11 +925,11 @@ err_remove_irqchip_mask:
gpiochip_irqchip_free_valid_mask(gc);
err_remove_acpi_chip:
acpi_gpiochip_remove(gc);
+ gpiochip_remove_pin_ranges(gc);
err_remove_of_chip:
gpiochip_free_hogs(gc);
of_gpiochip_remove(gc);
err_free_gpiochip_mask:
- gpiochip_remove_pin_ranges(gc);
gpiochip_free_valid_mask(gc);
if (gdev->dev.release) {
/* release() has been registered by gpiochip_setup_dev() */