Only manage ofw gpio providers on ofw systems
On arm64 we may boot via ACPI. In this case we will still try to manage the gpio providers as if we are using FDT. Fix this by checking if the FDT node is valid before registering a cross reference. Sponsored by: Innovate UK
This commit is contained in:
parent
365ed84f28
commit
f5e4e9153c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365558
@ -197,6 +197,7 @@ ofw_gpiobus_register_provider(device_t provider)
|
||||
phandle_t node;
|
||||
|
||||
node = ofw_bus_get_node(provider);
|
||||
if (node != -1)
|
||||
OF_device_register_xref(OF_xref_from_node(node), provider);
|
||||
}
|
||||
|
||||
@ -206,6 +207,7 @@ ofw_gpiobus_unregister_provider(device_t provider)
|
||||
phandle_t node;
|
||||
|
||||
node = ofw_bus_get_node(provider);
|
||||
if (node != -1)
|
||||
OF_device_register_xref(OF_xref_from_node(node), NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user