gpiolib: Deduplicate cleanup for-loop in gpiochip_add_data_with_key()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 4 Mar 2024 17:35:33 +0000 (19:35 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 5 Mar 2024 18:24:58 +0000 (19:24 +0100)
commit8ae438f5ff168cd0e3ba6e3cef7240fa5d110528
tree62066e2aa1bf90983550f2b58109dafc385e13fb
parente9c717bee8f109ec5f708297d2cc9d8b59348855
gpiolib: Deduplicate cleanup for-loop in gpiochip_add_data_with_key()

There is no need to repeat for-loop twice in the error path in
gpiochip_add_data_with_key(). Deduplicate it. While at it,
rename loop variable to be more specific and avoid ambguity.

It also properly unwinds the SRCU, i.e. in reversed order of allocating.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c