Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ow/owc_gpiobus.c
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | owc_gpiobus_identify(driver_t *driver, device_t bus) | ||||
* Find all the 1-wire bus pseudo-nodes that are | * Find all the 1-wire bus pseudo-nodes that are | ||||
* at the top level of the FDT. Would be nice to | * at the top level of the FDT. Would be nice to | ||||
* somehow preserve the node name of these busses, | * somehow preserve the node name of these busses, | ||||
* but there's no good place to put it. The driver's | * but there's no good place to put it. The driver's | ||||
* name is used for the device name, and the 1-wire | * name is used for the device name, and the 1-wire | ||||
* bus overwrites the description. | * bus overwrites the description. | ||||
*/ | */ | ||||
root = OF_finddevice("/"); | root = OF_finddevice("/"); | ||||
if (root == 0) | if (root == -1) | ||||
return; | return; | ||||
for (w1 = OF_child(root); w1 != 0; w1 = OF_peer(w1)) { | for (w1 = OF_child(root); w1 != 0; w1 = OF_peer(w1)) { | ||||
if (!fdt_is_compatible_strict(w1, "w1-gpio")) | if (!fdt_is_compatible_strict(w1, "w1-gpio")) | ||||
continue; | continue; | ||||
if (!OF_hasprop(w1, "gpios")) | if (!OF_hasprop(w1, "gpios")) | ||||
continue; | continue; | ||||
ofw_gpiobus_add_fdt_child(bus, driver->name, w1); | ofw_gpiobus_add_fdt_child(bus, driver->name, w1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 324 Lines • Show Last 20 Lines |