mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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: 5fc7cf8c8e
("gpio: add gpio-hog support")
Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
18030d9fa2
commit
11c341b118
1 changed files with 1 additions and 1 deletions
|
@ -1474,7 +1474,7 @@ static int gpio_post_bind(struct udevice *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (CONFIG_IS_ENABLED(GPIO_HOG)) {
|
||||
if (CONFIG_IS_ENABLED(GPIO_HOG) && dev_has_ofnode(dev)) {
|
||||
struct udevice *child;
|
||||
ofnode node;
|
||||
|
||||
|
|
Loading…
Reference in a new issue