Skip to content

Commit ea95bd8

Browse files
author
Bartosz Golaszewski
committed
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/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 3a40985 commit ea95bd8

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/gpio/gpiolib.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static struct gpio_desc *gpio_name_to_desc(const char * const name)
486486
* 1. Non-unique names are still accepted,
487487
* 2. Name collisions within the same GPIO chip are not reported.
488488
*/
489-
static int gpiochip_set_desc_names(struct gpio_chip *gc)
489+
static void gpiochip_set_desc_names(struct gpio_chip *gc)
490490
{
491491
struct gpio_device *gdev = gc->gpiodev;
492492
int i;
@@ -505,8 +505,6 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc)
505505
/* Then add all names to the GPIO descriptors */
506506
for (i = 0; i != gc->ngpio; ++i)
507507
gdev->descs[i].name = gc->names[i];
508-
509-
return 0;
510508
}
511509

512510
/*
@@ -1000,11 +998,9 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
1000998
INIT_LIST_HEAD(&gdev->pin_ranges);
1001999
#endif
10021000

1003-
if (gc->names) {
1004-
ret = gpiochip_set_desc_names(gc);
1005-
if (ret)
1006-
goto err_cleanup_desc_srcu;
1007-
}
1001+
if (gc->names)
1002+
gpiochip_set_desc_names(gc);
1003+
10081004
ret = gpiochip_set_names(gc);
10091005
if (ret)
10101006
goto err_cleanup_desc_srcu;

0 commit comments

Comments
 (0)