summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-shared.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2025-12-06 12:53:55 +0100
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2025-12-09 07:16:45 +0100
commitd382c765d083ad871b4a053059351edd348a2442 (patch)
tree6fe7952982d673776c1cbae3ee483cdf51c8c7db /drivers/gpio/gpiolib-shared.c
parentc904a0d8525d5f03529ae3176e99bd32466ece7b (diff)
gpio: shared: fix auxiliary device cleanup order
Dropping the last reference to the internal struct device should be the last thing we do so delete the device first and then uninit it which also involves the final put_device(). Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support") Link: https://lore.kernel.org/r/20251206-gpio-shared-teardown-fixes-v1-3-35ac458cfce1@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'drivers/gpio/gpiolib-shared.c')
-rw-r--r--drivers/gpio/gpiolib-shared.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c
index 4084a28a953a..2d3b0c3460e5 100644
--- a/drivers/gpio/gpiolib-shared.c
+++ b/drivers/gpio/gpiolib-shared.c
@@ -415,8 +415,8 @@ static void gpio_shared_remove_adev(struct auxiliary_device *adev)
{
lockdep_assert_held(&gpio_shared_lock);
- auxiliary_device_uninit(adev);
auxiliary_device_delete(adev);
+ auxiliary_device_uninit(adev);
}
int gpio_device_setup_shared(struct gpio_device *gdev)