[PATCH 0/2] gpio: don't compare raw GPIO descriptor pointers directly

From: Bartosz Golaszewski
Date: Mon Apr 07 2025 - 03:08:29 EST


Handling of shared GPIOs in the kernel needs some improvements. Let's
start with a simple change of not comparing GPIO descriptor pointers
directly as there's nothing that guarantees that the same physical pin
will always be represented by a single GPIO descriptor obtained by
calling gpiod_get().

For merging: I suggest to take patch 1/2 through the GPIO tree and
provide an immutable tag for the regulator tree.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
---
Bartosz Golaszewski (2):
gpio: provide gpiod_is_equal()
regulator: don't compare raw GPIO descriptor pointers

drivers/gpio/gpiolib.c | 14 ++++++++++++++
drivers/regulator/core.c | 2 +-
include/linux/gpio/consumer.h | 9 +++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250402-gpiod-is-equal-4e28bb8ab842

Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>