Date: Tue, 2 Mar 2010 21:10:44 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r204602 - head/share/man/man9 Message-ID: <201003022110.o22LAiOo044372@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Tue Mar 2 21:10:44 2010 New Revision: 204602 URL: http://svn.freebsd.org/changeset/base/204602 Log: - 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. Modified: head/share/man/man9/driver.9 Modified: head/share/man/man9/driver.9 ============================================================================== --- head/share/man/man9/driver.9 Tue Mar 2 20:20:53 2010 (r204601) +++ head/share/man/man9/driver.9 Tue Mar 2 21:10:44 2010 (r204602) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003022110.o22LAiOo044372>