Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: gpio: GPIO_DT_SPEC_GET_BY_IDX_OR: use default if idx invalid #83410

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

henrikbrixandersen
Copy link
Member

@henrikbrixandersen henrikbrixandersen commented Dec 26, 2024

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 be 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.

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants