Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/extres/clk/clk_bus.c
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | ofw_clkbus_probe(device_t dev) | ||||
device_set_desc(dev, "OFW clocks bus"); | device_set_desc(dev, "OFW clocks bus"); | ||||
return (BUS_PROBE_GENERIC); | return (BUS_PROBE_GENERIC); | ||||
} | } | ||||
static int | static int | ||||
ofw_clkbus_attach(device_t dev) | ofw_clkbus_attach(device_t dev) | ||||
{ | { | ||||
struct ofw_clkbus_softc *sc; | |||||
phandle_t node, child; | phandle_t node, child; | ||||
device_t cdev; | device_t cdev; | ||||
sc = device_get_softc(dev); | |||||
node = ofw_bus_get_node(dev); | node = ofw_bus_get_node(dev); | ||||
simplebus_init(dev, node); | simplebus_init(dev, node); | ||||
for (child = OF_child(node); child > 0; child = OF_peer(child)) { | for (child = OF_child(node); child > 0; child = OF_peer(child)) { | ||||
cdev = simplebus_add_device(dev, child, 0, NULL, -1, NULL); | cdev = simplebus_add_device(dev, child, 0, NULL, -1, NULL); | ||||
if (cdev != NULL) | if (cdev != NULL) | ||||
device_probe_and_attach(cdev); | device_probe_and_attach(cdev); | ||||
} | } | ||||
Show All 18 Lines |