gpiolib: Check array_info for NULL only once in gpiod_get_array()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 21 Mar 2023 13:54:12 +0000 (15:54 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 29 Mar 2023 16:11:23 +0000 (18:11 +0200)
commit4ea0c97776bf8c63805eb0f8182d9c20072219d9
treebda5e8b20c6d9ccce80db52c84cb67da0073592a
parent79736429c97f517247645e73e75c956efd09ad03
gpiolib: Check array_info for NULL only once in gpiod_get_array()

gpiod_get_array() has a long if-else-if branching where each of them
tests for the same variable to be not NULL. Instead, check for NULL
before even going to that flow.

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