diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2010-03-02 21:10:44 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2010-03-02 21:10:44 +0000 |
commit | 0884cae17b8bb0026a52953c6b42250cd1a32bff (patch) | |
tree | 91aa62f456838806a0747604930fd6030c7f5b57 /share | |
parent | 4ef20db290841afbfce7fe484e2037e084e79238 (diff) | |
download | src-0884cae17b8bb0026a52953c6b42250cd1a32bff.tar.gz src-0884cae17b8bb0026a52953c6b42250cd1a32bff.zip |
- Add missing includes to make example "compilable".
- Use C99 initializer just in case if driver_t may change in future.
- Use NULL for pointer arguments instead of 0.
Notes
Notes:
svn path=/head/; revision=204602
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/driver.9 | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/share/man/man9/driver.9 b/share/man/man9/driver.9 index 0030915fc623..dad6760586ab 100644 --- a/share/man/man9/driver.9 +++ b/share/man/man9/driver.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd March 3, 2010 .Dt DRIVER 9 .Os .Sh NAME @@ -37,7 +37,9 @@ .Sh SYNOPSIS .Bd -literal #include <sys/param.h> +#include <sys/kernel.h> #include <sys/bus.h> +#include <sys/module.h> static int foo_probe(device_t); static int foo_attach(device_t); @@ -59,15 +61,15 @@ static device_method_t foo_methods[] = { { 0, 0 } }; -static driver_t foo_driver { - "foo", - foo_methods, - sizeof(struct foo_softc) +static driver_t foo_driver = { + .name = "foo", + .methods = foo_methods, + .size = sizeof(struct foo_softc) }; static devclass_t foo_devclass; -DRIVER_MODULE(foo, bogo, foo_driver, foo_devclass, 0, 0); +DRIVER_MODULE(foo, bogo, foo_driver, foo_devclass, NULL, NULL); .Ed .Sh DESCRIPTION Each driver in the kernel is described by a |