From 4742483206b4fcebc64ca1e4e2b5835c0dda410b Mon Sep 17 00:00:00 2001 From: marius Date: Fri, 25 Nov 2011 17:07:27 +0000 Subject: [PATCH] MFC: r227829, r227844 - Add a DEVMETHOD_END alias for KOBJMETHOD_END so that along with 'driver_t' and DEVMETHOD() we can fully hide the explicit mention of kobj(9) from device drivers. - Update the device driver examples to use DEVMETHOD_END. Submitted by: jhb Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/9.0@227977 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- share/examples/drivers/make_device_driver.sh | 2 +- share/man/man9/driver.9 | 4 ++-- sys/sys/bus.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh index d7b92593..4796a0c6 100755 --- a/share/examples/drivers/make_device_driver.sh +++ b/share/examples/drivers/make_device_driver.sh @@ -261,7 +261,7 @@ static device_method_t ${1}_methods[] = { DEVMETHOD(device_probe, ${1}_isa_probe), DEVMETHOD(device_attach, ${1}_isa_attach), DEVMETHOD(device_detach, ${1}_isa_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t ${1}_isa_driver = { diff --git a/share/man/man9/driver.9 b/share/man/man9/driver.9 index 960c9ae9..93ab992c 100644 --- a/share/man/man9/driver.9 +++ b/share/man/man9/driver.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2010 +.Dd November 22, 2011 .Dt DRIVER 9 .Os .Sh NAME @@ -58,7 +58,7 @@ static device_method_t foo_methods[] = { DEVMETHOD(bogo_twiddle, foo_twiddle), /* Terminate method list */ - { 0, 0 } + DEVMETHOD_END }; static driver_t foo_driver = { diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 5dc92dfe..e561042b 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -570,9 +570,10 @@ extern int bus_current_pass; void bus_set_pass(int pass); /** - * Shorthand for constructing method tables. + * Shorthands for constructing method tables. */ #define DEVMETHOD KOBJMETHOD +#define DEVMETHOD_END KOBJMETHOD_END /* * Some common device interfaces. -- 2.42.0