summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-05-27 21:46:13 +0200
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>2024-06-03 16:04:38 +0200
commitea95bd851068803eb37693b2e32111b88077c901 (patch)
tree3b440dc04ca2e78714ee004cf988ef615bc49956 /drivers/gpio
parentdt-bindings: gpio: aspeed,sgpio: Specify #interrupt-cells (diff)
downloadlinux-ea95bd851068803eb37693b2e32111b88077c901.tar.xz
linux-ea95bd851068803eb37693b2e32111b88077c901.zip
gpiolib: make gpiochip_set_desc_names() return void
gpiochip_set_desc_names() cannot fail so drop its return value. Link: https://lore.kernel.org/r/20240527194613.197810-1-brgl@bgdev.pl Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 1a9aadd4c803..ea723cf1c87f 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -486,7 +486,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;
@@ -505,8 +505,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;
}
/*
@@ -1000,11 +998,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;