diff mbox series

gpiolib: make gpiochip_set_desc_names() return void

Message ID 20240527194613.197810-1-brgl@bgdev.pl
State New
Headers show
Series gpiolib: make gpiochip_set_desc_names() return void | expand

Commit Message

Bartosz Golaszewski May 27, 2024, 7:46 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

gpiochip_set_desc_names() cannot fail so drop its return value.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpiolib.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Bartosz Golaszewski June 3, 2024, 2:04 p.m. UTC | #1
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Mon, 27 May 2024 21:46:13 +0200, Bartosz Golaszewski wrote:
> gpiochip_set_desc_names() cannot fail so drop its return value.
> 
> 

Applied, thanks!

[1/1] gpiolib: make gpiochip_set_desc_names() return void
      commit: ea95bd851068803eb37693b2e32111b88077c901

Best regards,
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index fa62367ee929..07e36e15f71f 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -485,7 +485,7 @@  static struct gpio_desc *gpio_name_to_desc(const char * const name)
  *   1. Non-unique names are still accepted,
  *   2. Name collisions within the same GPIO chip are not reported.
  */
-static int gpiochip_set_desc_names(struct gpio_chip *gc)
+static void gpiochip_set_desc_names(struct gpio_chip *gc)
 {
 	struct gpio_device *gdev = gc->gpiodev;
 	int i;
@@ -504,8 +504,6 @@  static int gpiochip_set_desc_names(struct gpio_chip *gc)
 	/* Then add all names to the GPIO descriptors */
 	for (i = 0; i != gc->ngpio; ++i)
 		gdev->descs[i].name = gc->names[i];
-
-	return 0;
 }
 
 /*
@@ -999,11 +997,9 @@  int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
 	INIT_LIST_HEAD(&gdev->pin_ranges);
 #endif
 
-	if (gc->names) {
-		ret = gpiochip_set_desc_names(gc);
-		if (ret)
-			goto err_cleanup_desc_srcu;
-	}
+	if (gc->names)
+		gpiochip_set_desc_names(gc);
+
 	ret = gpiochip_set_names(gc);
 	if (ret)
 		goto err_cleanup_desc_srcu;