]> git.baikalelectronics.ru Git - uboot.git/commit
gpio: Avoid using an invalid ofnode
authorSimon Glass <sjg@chromium.org>
Thu, 1 Jun 2023 16:22:30 +0000 (10:22 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 14 Jul 2023 16:54:50 +0000 (12:54 -0400)
commit5d261a9de2e3b6ed4b8bcfa024f65f4ffb5c533a
tree2f5935b7941a59074666ee83e9983d169254137b
parent6ce6fce3e8c23baddd9696f0e1ecad36248b00e9
gpio: Avoid using an invalid ofnode

Devices do not necessarily have nodes attached to them, since they can be
created from platdata. In SPL a devicetree may in fact not exist at all.

Check the node before using it. This avoids failure when OF_CHECKS is
enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 3cf66ae49cb ("gpio: add gpio-hog support")
Reviewed-by: Heiko Schocher <hs@denx.de>
drivers/gpio/gpio-uclass.c