Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: gpio: GPIO_DT_SPEC_GET_BY_IDX_OR: use default if idx invalid
It is not sufficient to check if the given node_id has the requested property in GPIO_DT_SPEC_GET_BY_IDX_OR(), the index also needs to valid. Change the logic to test for a valid index (which, in turn, also checks if the property is valid), otherwise return the default value provided by the caller. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
- Loading branch information