Skip to content
Commit ee250a11 authored by Henrik Brix Andersen's avatar Henrik Brix Andersen
Browse files

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: default avatarHenrik Brix Andersen <henrik@brixandersen.dk>
parent 3c420a48
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment