mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
dm: core: Use dev_has_ofnode() instead of dev_of_valid()
We have two functions which do the same thing. Standardise on dev_has_ofnode() since there is no such thing as an 'invalid' ofnode in normal operation: it is either null or missing. Also move the functions into one place. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
@@ -120,13 +120,13 @@ static int dm_test_pci_drvdata(struct unit_test_state *uts)
|
||||
|
||||
ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(1, 0x08, 0), &swap));
|
||||
ut_asserteq(SWAP_CASE_DRV_DATA, swap->driver_data);
|
||||
ut_assertok(dev_of_valid(swap));
|
||||
ut_assertok(dev_has_ofnode(swap));
|
||||
ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(1, 0x0c, 0), &swap));
|
||||
ut_asserteq(SWAP_CASE_DRV_DATA, swap->driver_data);
|
||||
ut_assertok(dev_of_valid(swap));
|
||||
ut_assertok(dev_has_ofnode(swap));
|
||||
ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(1, 0x10, 0), &swap));
|
||||
ut_asserteq(SWAP_CASE_DRV_DATA, swap->driver_data);
|
||||
ut_assertok(!dev_of_valid(swap));
|
||||
ut_assertok(!dev_has_ofnode(swap));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user