From 997c87bb0b1981fd33e34cefc26d9138f27326ce Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 23 Jul 2014 06:55:19 -0600 Subject: dm: Add functions to access a device's children Devices can have childen that can be addressed by a simple index, the sequence number or a device tree offset. Add functions to access a child in each of these ways. The index is typically used as a fallback when the sequence number is not available. For example we may use a serial UART with sequence number 0 as the console, but if no UART has sequence number 0, then we can fall back to just using the first UART (index 0). The device tree offset function is useful for buses, where they want to locate one of their children. The device tree can be scanned to find the offset of each child, and that offset can then find the device. Signed-off-by: Simon Glass --- doc/driver-model/README.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/driver-model') diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt index a2b6122ebcb..59ef05cf2b5 100644 --- a/doc/driver-model/README.txt +++ b/doc/driver-model/README.txt @@ -95,13 +95,14 @@ are provided in test/dm. To run them, try: You should see something like this: <...U-Boot banner...> - Running 18 driver model tests + Running 19 driver model tests Test: dm_test_autobind Test: dm_test_autoprobe Test: dm_test_bus_children Device 'd-test': seq 3 is in use by 'b-test' Device 'c-test@0': seq 0 is in use by 'a-test' Device 'c-test@1': seq 1 is in use by 'd-test' + Test: dm_test_bus_children_funcs Test: dm_test_children Test: dm_test_fdt Device 'd-test': seq 3 is in use by 'b-test' -- cgit v1.2.3