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. (cherry picked from commit ee250a1) Original-Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk> GitOrigin-RevId: ee250a1 Cr-Build-Id: 8727042214506707905 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8727042214506707905 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: Icbe25dfba647142db3536e9a5a53a6b0d871d75e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6134540 Commit-Queue: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Bot-Commit: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
- Loading branch information