From: Bartosz Golaszewski Date: Fri, 29 Sep 2017 16:20:30 +0000 (+0200) Subject: core: rename gpiod_line_find_by_name() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f14784739172cf6857516a96d28856292b6fbeb7;p=qemu-gpiodev%2Flibgpiod.git core: rename gpiod_line_find_by_name() Shorten the name of the line lookup routine as any other type of lookup wouldn't make sense anyway. Signed-off-by: Bartosz Golaszewski --- diff --git a/include/gpiod.h b/include/gpiod.h index 379b88c..7b32f70 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -888,7 +888,7 @@ int gpiod_line_set_value_bulk(struct gpiod_line_bulk *bulk, * If this routine succeeds, the user must manually close the GPIO chip owning * this line to avoid memory leaks. */ -struct gpiod_line * gpiod_line_find_by_name(const char *name) GPIOD_API; +struct gpiod_line * gpiod_line_find(const char *name) GPIOD_API; /** * @brief Close a GPIO chip owning this line and release all resources. diff --git a/src/lib/core.c b/src/lib/core.c index 3b3b6ef..f3bfddf 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -921,7 +921,7 @@ int gpiod_line_set_value_bulk(struct gpiod_line_bulk *bulk, int *values) return 0; } -struct gpiod_line * gpiod_line_find_by_name(const char *name) +struct gpiod_line * gpiod_line_find(const char *name) { struct gpiod_chip_iter *chip_iter; struct gpiod_line_iter line_iter; diff --git a/src/tools/gpiofind.c b/src/tools/gpiofind.c index 221687b..ac06cfd 100644 --- a/src/tools/gpiofind.c +++ b/src/tools/gpiofind.c @@ -63,7 +63,7 @@ int main(int argc, char **argv) if (argc != 1) die("exactly one GPIO line name must be specified"); - line = gpiod_line_find_by_name(argv[0]); + line = gpiod_line_find(argv[0]); if (!line) return EXIT_FAILURE; diff --git a/tests/tests-line.c b/tests/tests-line.c index b68578f..38c4bae 100644 --- a/tests/tests-line.c +++ b/tests/tests-line.c @@ -282,7 +282,7 @@ static void line_find_by_name_good(void) { TEST_CLEANUP(test_line_close_chip) struct gpiod_line *line = NULL; - line = gpiod_line_find_by_name("gpio-mockup-C-12"); + line = gpiod_line_find("gpio-mockup-C-12"); TEST_ASSERT_NOT_NULL(line); TEST_ASSERT_EQ(gpiod_line_offset(line), 12);