mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-16 14:08:45 +00:00
test: ofnode: test ofnode_device_is_compatible()
Test ofnode_device_is_compatible(), and also ofnode_path(). Requested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
99552c3435
commit
04ca871459
2 changed files with 18 additions and 0 deletions
|
@ -21,6 +21,7 @@ obj-$(CONFIG_DM_I2C) += i2c.o
|
|||
obj-$(CONFIG_LED) += led.o
|
||||
obj-$(CONFIG_DM_MAILBOX) += mailbox.o
|
||||
obj-$(CONFIG_DM_MMC) += mmc.o
|
||||
obj-y += ofnode.o
|
||||
obj-$(CONFIG_DM_PCI) += pci.o
|
||||
obj-$(CONFIG_PHY) += phy.o
|
||||
obj-$(CONFIG_POWER_DOMAIN) += power-domain.o
|
||||
|
|
17
test/dm/ofnode.c
Normal file
17
test/dm/ofnode.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
#include <common.h>
|
||||
#include <dm.h>
|
||||
#include <dm/test.h>
|
||||
#include <test/ut.h>
|
||||
|
||||
static int dm_test_ofnode_compatible(struct unit_test_state *uts)
|
||||
{
|
||||
ofnode root_node = ofnode_path("/");
|
||||
|
||||
ut_assert(ofnode_valid(root_node));
|
||||
ut_assert(ofnode_device_is_compatible(root_node, "sandbox"));
|
||||
|
||||
return 0;
|
||||
}
|
||||
DM_TEST(dm_test_ofnode_compatible, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
|
Loading…
Add table
Reference in a new issue