diff mbox series

[3/5] gpio: aggregator: Return an error if there are no GPIOs in gpio_aggregator_parse()

Message ID 9dcd5fda7a3819e896d9eee4156e7c46c9a64595.1744452787.git.dan.carpenter@linaro.org
State New
Headers show
Series gpio: aggregator: Fix Smatch warnings | expand

Commit Message

Dan Carpenter April 12, 2025, 10:15 a.m. UTC
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>
---
 drivers/gpio/gpio-aggregator.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index e1b2efc0df99..62bb50af7cda 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -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;
 	}