]> www.infradead.org Git - users/jedix/linux-maple.git/commit
gpiolib: Simplify implementation of for_each_hwgpio_in_range()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 7 Feb 2025 15:07:35 +0000 (17:07 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 12 Feb 2025 14:20:16 +0000 (15:20 +0100)
commit767412f092fc6e04147305acd70f15770ece47ec
tree26ee4a9279ac2a2861e1f866c4a9696ca45508ca
parent8893516000b247f91fa2cef34f2a77b609e661a4
gpiolib: Simplify implementation of for_each_hwgpio_in_range()

The whole purpose of the custom CLASS() is to have possibility
to initialise the counter variable _i to 0. This can't be done
with simple __free() macro as it will be not allowed by C language.
OTOH, the CLASS() operates with the pointers and explicit usage of
the scoped variable _data is not needed, since the pointers are kept
the same over the iterations. Simplify the implementation of
for_each_hwgpio_in_range().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250207151149.2119765-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
include/linux/gpio/driver.h