diff options
| author | Mark Brown <broonie@kernel.org> | 2025-04-09 17:51:31 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-04-09 17:51:31 +0100 |
| commit | 36ddc9ec8f3ec00eb4c88631807d02f96e05c0e7 (patch) | |
| tree | 8c6b9859d4aae29bf88eabf9d6ebb9cedb85adb3 /include/linux/gpio/consumer.h | |
| parent | 4a7c28e659b85c96ebc87ad00d11c47a538dc15e (diff) | |
| parent | aaf6223ea2a1ff9316a81bf851fd5a0e82635b60 (diff) | |
gpio: don't compare raw GPIO descriptor pointers
Merge series from Bartosz Golaszewski <brgl@bgdev.pl>:
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().
Diffstat (limited to 'include/linux/gpio/consumer.h')
| -rw-r--r-- | include/linux/gpio/consumer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index 45b651c05b9c..7355abadaef4 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -180,6 +180,8 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev, enum gpiod_flags flags, const char *label); +bool gpiod_is_equal(struct gpio_desc *desc, struct gpio_desc *other); + #else /* CONFIG_GPIOLIB */ #include <linux/bug.h> @@ -547,6 +549,13 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev, return ERR_PTR(-ENOSYS); } +static inline bool +gpiod_is_equal(struct gpio_desc *desc, struct gpio_desc *other) +{ + WARN_ON(desc || other); + return false; +} + #endif /* CONFIG_GPIOLIB */ #if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_HTE) |
