clk_bus.c (be82b3a0bf72ed3b5f01ac9fcd8dcd3802e3c742) clk_bus.c (18250ec6c089c0c50cbd9fd87d78e03ff89916df)
1/*-
2 * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 55 unchanged lines hidden (view full) ---

64 simplebus_init(dev, node);
65
66 for (child = OF_child(node); child > 0; child = OF_peer(child)) {
67 cdev = simplebus_add_device(dev, child, 0, NULL, -1, NULL);
68 if (cdev != NULL)
69 device_probe_and_attach(cdev);
70 }
71
1/*-
2 * Copyright 2016 Michal Meloun <mmel@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 55 unchanged lines hidden (view full) ---

64 simplebus_init(dev, node);
65
66 for (child = OF_child(node); child > 0; child = OF_peer(child)) {
67 cdev = simplebus_add_device(dev, child, 0, NULL, -1, NULL);
68 if (cdev != NULL)
69 device_probe_and_attach(cdev);
70 }
71
72 return (bus_generic_attach(dev));
72 bus_attach_children(dev);
73 return (0);
73}
74
75static device_method_t ofw_clkbus_methods[] = {
76 /* Device interface */
77 DEVMETHOD(device_probe, ofw_clkbus_probe),
78 DEVMETHOD(device_attach, ofw_clkbus_attach),
79
80 DEVMETHOD_END
81};
82
83DEFINE_CLASS_1(ofw_clkbus, ofw_clkbus_driver, ofw_clkbus_methods,
84 sizeof(struct ofw_clkbus_softc), simplebus_driver);
85EARLY_DRIVER_MODULE(ofw_clkbus, simplebus, ofw_clkbus_driver, 0, 0,
86 BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
87MODULE_VERSION(ofw_clkbus, 1);
74}
75
76static device_method_t ofw_clkbus_methods[] = {
77 /* Device interface */
78 DEVMETHOD(device_probe, ofw_clkbus_probe),
79 DEVMETHOD(device_attach, ofw_clkbus_attach),
80
81 DEVMETHOD_END
82};
83
84DEFINE_CLASS_1(ofw_clkbus, ofw_clkbus_driver, ofw_clkbus_methods,
85 sizeof(struct ofw_clkbus_softc), simplebus_driver);
86EARLY_DRIVER_MODULE(ofw_clkbus, simplebus, ofw_clkbus_driver, 0, 0,
87 BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
88MODULE_VERSION(ofw_clkbus, 1);