Immutable tag for the regulator tree to pull from

gpio: provide gpiod_is_equal()
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmf2JGEACgkQEacuoBRx
 13I6MBAAti6vHNjIVP3WTK3c1c/eTa6zKUvg2A2b7YEKuKM1b8DibaaCdo9BK/OQ
 6IzaPGJXF8Us5ebDZjIhuvfRCqghDMIhEbGd8J9239a3oxCeu35inLwC4pBPO4qv
 ILV3+3fI7x3FHKH3+qiiVJQaP76e0uEsFjkPVJBmmJkpOQIjq6/cey2XCCEHjbJd
 DeY/5Vi37HPeGQaNeFXDdwMNgHn4aU4ketBuOZ7ws18sEndduSpkDVZv7egDvlpb
 dJ30/BWE7TzRiHTiqn3Rq1F/D7Y3Jztbw3HKDDNeglzFaqFWgbppxmdaL952Dm0t
 FJmvndieOewMiBeAw9DKX0qMkTG+qec9s6oAIclD9D3AgH6VbM3UnanHnamljwP0
 kPeDKrq+v6ffmUSkWa6BtGriPGj5IamnCCDg9LqTALAvb7IfoO97/PeGKiHibEA/
 wmeREEeFHAJ2PPaZbyHqq9fLB13mUr0Ee4Ch363H5VN7bPM9jK84PdxCuD2Hpyjn
 RpGw5m2YApNql/qWShvuVQQ+vUTb/H/K/YPsXcv2bV7OYyS0K1jb/xaM73afyvth
 pwVK+Wk4Ch3fIf3G9CG8l7oC3SF2fCJVdibQ3/wJ5tFmjwF5sJvH6oosdJ71c2ZF
 47Zc1QGezIaUgpTpywlwOREnlnlSPwJhrnDWqI/GSkkwyvnXLOA=
 =DTEb
 -----END PGP SIGNATURE-----

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()
This commit is contained in:
Bartosz Golaszewski 2025-04-09 09:58:22 +02:00
commit dad3386b18
2 changed files with 23 additions and 0 deletions

View File

@ -265,6 +265,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

View File

@ -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)