diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-04-09 09:58:22 +0200 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2025-04-09 09:58:22 +0200 |
| commit | dad3386b182eb1356149d11fd969ac318e40efa3 (patch) | |
| tree | 3392946a2a4c9f01f4dff83d8fdc2263bce17358 /drivers/gpio/gpiolib.c | |
| parent | 27986833e8e675b6c17654d13623590a46f9033e (diff) | |
| parent | 265daffe788aa1cc5925d0afcde4fe6e99c66638 (diff) | |
Merge tag 'gpiod-is-equal-for-v6.16-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/brgl/linux into gpio/for-next
Immutable tag for the regulator tree to pull from
gpio: provide gpiod_is_equal()
Diffstat (limited to 'drivers/gpio/gpiolib.c')
| -rw-r--r-- | drivers/gpio/gpiolib.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index ed8397a88dea..f208901ba478 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -266,6 +266,20 @@ struct gpio_device *gpiod_to_gpio_device(struct gpio_desc *desc) EXPORT_SYMBOL_GPL(gpiod_to_gpio_device); /** + * gpiod_is_equal() - Check if two GPIO descriptors refer to the same pin. + * @desc: Descriptor to compare. + * @other: The second descriptor to compare against. + * + * Returns: + * True if the descriptors refer to the same physical pin. False otherwise. + */ +bool gpiod_is_equal(struct gpio_desc *desc, struct gpio_desc *other) +{ + return desc == other; +} +EXPORT_SYMBOL_GPL(gpiod_is_equal); + +/** * gpio_device_get_base() - Get the base GPIO number allocated by this device * @gdev: GPIO device * |