Date: Sun, 13 Jun 2010 12:58:31 +0000 (UTC) From: Rafal Jaworowski <raj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r209127 - head/sys/dev/fdt Message-ID: <201006131258.o5DCwV9I031316@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: raj Date: Sun Jun 13 12:58:31 2010 New Revision: 209127 URL: http://svn.freebsd.org/changeset/base/209127 Log: Provide identify method for the fdtbus(4). Reviewed by: imp Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/fdt/fdtbus.c Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Sun Jun 13 12:53:44 2010 (r209126) +++ head/sys/dev/fdt/fdtbus.c Sun Jun 13 12:58:31 2010 (r209127) @@ -77,6 +77,7 @@ struct fdtbus_softc { /* * Prototypes. */ +static void fdtbus_identify(driver_t *, device_t); static int fdtbus_probe(device_t); static int fdtbus_attach(device_t); @@ -109,6 +110,7 @@ static void newbus_device_from_fdt_node( */ static device_method_t fdtbus_methods[] = { /* Device interface */ + DEVMETHOD(device_identify, fdtbus_identify), DEVMETHOD(device_probe, fdtbus_probe), DEVMETHOD(device_attach, fdtbus_attach), DEVMETHOD(device_detach, bus_generic_detach), @@ -144,6 +146,14 @@ devclass_t fdtbus_devclass; DRIVER_MODULE(fdtbus, nexus, fdtbus_driver, fdtbus_devclass, 0, 0); +static void +fdtbus_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "fdtbus", -1) == NULL) + BUS_ADD_CHILD(parent, 0, "fdtbus", -1); +} + static int fdtbus_probe(device_t dev) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006131258.o5DCwV9I031316>