diff options
author | Marius Strobl <marius@FreeBSD.org> | 2011-11-22 21:28:20 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2011-11-22 21:28:20 +0000 |
commit | 4b7ec27007570e0ce4fe9dbb447e7afc131b487a (patch) | |
tree | 4941db3a873a5f9b2ccc4a64c23bf5cd65516206 /sys/powerpc/ofw | |
parent | 21c8beb9fd4c49e791b4347f7b535315735a398a (diff) | |
download | src-4b7ec27007570e0ce4fe9dbb447e7afc131b487a.tar.gz src-4b7ec27007570e0ce4fe9dbb447e7afc131b487a.zip |
- There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
(bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
since r52045) but even recently added device drivers do this unnecessarily.
Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
Discussed with: jhb
- Also while at it, use __FBSDID.
Notes
Notes:
svn path=/head/; revision=227843
Diffstat (limited to 'sys/powerpc/ofw')
-rw-r--r-- | sys/powerpc/ofw/ofw_cpu.c | 13 | ||||
-rw-r--r-- | sys/powerpc/ofw/ofw_pcib_pci.c | 11 |
2 files changed, 10 insertions, 14 deletions
diff --git a/sys/powerpc/ofw/ofw_cpu.c b/sys/powerpc/ofw/ofw_cpu.c index 846556e13017..b50e3141eca1 100644 --- a/sys/powerpc/ofw/ofw_cpu.c +++ b/sys/powerpc/ofw/ofw_cpu.c @@ -21,10 +21,11 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -51,9 +52,7 @@ static device_method_t ofw_cpulist_methods[] = { DEVMETHOD(device_attach, ofw_cpulist_attach), /* Bus interface */ - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_child_pnpinfo_str, ofw_bus_gen_child_pnpinfo_str), /* ofw_bus interface */ @@ -64,7 +63,7 @@ static device_method_t ofw_cpulist_methods[] = { DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } + DEVMETHOD_END }; static driver_t ofw_cpulist_driver = { @@ -140,9 +139,7 @@ static device_method_t ofw_cpu_methods[] = { DEVMETHOD(device_attach, ofw_cpu_attach), /* Bus interface */ - DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, ofw_cpu_read_ivar), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -150,7 +147,7 @@ static device_method_t ofw_cpu_methods[] = { DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), - { 0, 0 } + DEVMETHOD_END }; static driver_t ofw_cpu_driver = { diff --git a/sys/powerpc/ofw/ofw_pcib_pci.c b/sys/powerpc/ofw/ofw_pcib_pci.c index 22554df8a4be..5ecddb3b20cd 100644 --- a/sys/powerpc/ofw/ofw_pcib_pci.c +++ b/sys/powerpc/ofw/ofw_pcib_pci.c @@ -23,10 +23,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + #include <sys/param.h> #include <sys/module.h> #include <sys/bus.h> @@ -61,7 +62,6 @@ static device_method_t ofw_pcib_pci_methods[] = { DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, pcib_read_ivar), DEVMETHOD(bus_write_ivar, pcib_write_ivar), DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), @@ -83,9 +83,9 @@ static device_method_t ofw_pcib_pci_methods[] = { DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ - DEVMETHOD(ofw_bus_get_node, ofw_pcib_pci_get_node), + DEVMETHOD(ofw_bus_get_node, ofw_pcib_pci_get_node), - {0, 0} + DEVMETHOD_END }; static devclass_t pcib_devclass; @@ -101,7 +101,6 @@ struct ofw_pcib_softc { struct ofw_bus_iinfo ops_iinfo; }; - DEFINE_CLASS_0(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, sizeof(struct ofw_pcib_softc)); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0); |