treewide: simplify line lookup
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 18 Jan 2021 15:51:47 +0000 (16:51 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 18 Mar 2021 08:34:15 +0000 (09:34 +0100)
commit0dcbafee3db1bfd55f9be44aeca3a5eddb3f6a68
treef2abd22b18167aad561ea2a74b6866bc389039b9
parentafb9568444ef9ae6316d279162f71b8160cb48fa
treewide: simplify line lookup

We're preparing to entirely remove the line objects from the API and
split their functionality between two new objects: line_info and
line_request. The lookup functions must be limited in the process.

This reworks all the find_line methods to: a) always assume that names
looked for are unique within a single chip (because while it's
technically possible for GPIO line names to be non-unique, it doesn't
make sense to look for two lines named the same) and b) return the
hardware offset within the chip instead of the line object.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
bindings/cxx/chip.cpp
bindings/cxx/examples/gpiofindcxx.cpp
bindings/cxx/gpiod.hpp
bindings/cxx/tests/tests-chip.cpp
bindings/python/examples/gpiofind.py
bindings/python/gpiodmodule.c
bindings/python/tests/gpiod_py_test.py
include/gpiod.h
lib/helpers.c
tests/tests-chip.c
tools/gpiofind.c