]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: aggregator: Return an error if there are no GPIOs in gpio_aggregator_parse()
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 12 Apr 2025 10:15:16 +0000 (13:15 +0300)
committerBartosz Golaszewski <brgl@bgdev.pl>
Mon, 14 Apr 2025 20:25:20 +0000 (22:25 +0200)
The error handling in gpio_aggregator_parse() was re-written.  It now
returns success if there are no GPIOs.  Restore the previous behavior
and return -EINVAL instead.

Fixes: 83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Koichiro Den <koichiro.den@canonical.com>
Link: https://lore.kernel.org/r/9dcd5fda7a3819e896d9eee4156e7c46c9a64595.1744452787.git.dan.carpenter@linaro.org
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpio-aggregator.c

index e1b2efc0df99f98c4092a6fb5e2f422fb2e8cb25..62bb50af7cdaa97e50f568d4ca28956d5f3af5af 100644 (file)
@@ -1128,6 +1128,7 @@ static int gpio_aggregator_parse(struct gpio_aggregator *aggr)
 
        if (!n) {
                pr_err("No GPIOs specified\n");
+               error = -EINVAL;
                goto err;
        }