core: rename gpiod_line_find_by_name()
authorBartosz Golaszewski <bartekgola@gmail.com>
Fri, 29 Sep 2017 16:20:30 +0000 (18:20 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Fri, 29 Sep 2017 16:20:30 +0000 (18:20 +0200)
Shorten the name of the line lookup routine as any other type of
lookup wouldn't make sense anyway.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
include/gpiod.h
src/lib/core.c
src/tools/gpiofind.c
tests/tests-line.c

index 379b88cbb8253bd20f3e075dfe275291c16cdd6e..7b32f7019c5c6d3e86e4525f748961ba94387c51 100644 (file)
@@ -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.
index 3b3b6efb129515ad508c269e5b138ba01eb21cfc..f3bfddfea2e30ce185402cc9599627b20d949bbc 100644 (file)
@@ -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;
index 221687bd67bab0897af25e55d305a3189a88c882..ac06cfddcdf3846cf11b51917cc01d7fc2ad3d2f 100644 (file)
@@ -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;
 
index b68578f770e39a644d2bbcadb3f8d3b3fec093a3..38c4bae06efc1df6962a6221d9a6db4f67d1cb55 100644 (file)
@@ -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);