mirror of
https://github.com/ipxe/ipxe
synced 2026-02-11 13:49:51 +03:00
[fdt] Use phandle as device location
Consumption of phandles will be in the form of locating a functional device (e.g. a GPIO device, or an I2C device, or a reset controller) by phandle, rather than locating the device tree node to which the phandle refers. Repurpose fdt_phandle() to obtain the phandle value (instead of searching by phandle), and record this value as the bus location within the generic device structure. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -219,6 +219,7 @@ int dt_probe_node ( struct device *parent, unsigned int offset ) {
|
||||
dt->name = dt->dev.name;
|
||||
snprintf ( dt->dev.name, sizeof ( dt->dev.name ), "%s", name );
|
||||
dt->dev.desc.bus_type = BUS_TYPE_DT;
|
||||
dt->dev.desc.location = fdt_phandle ( &sysfdt, offset );
|
||||
dt->dev.parent = parent;
|
||||
INIT_LIST_HEAD ( &dt->dev.children );
|
||||
list_add_tail ( &dt->dev.siblings, &parent->children );
|
||||
|
||||
Reference in New Issue
Block a user