aboutsummaryrefslogtreecommitdiff
path: root/sys/sparc64/fhc/fhc_nexus.c
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2005-11-22 16:39:44 +0000
committerMarius Strobl <marius@FreeBSD.org>2005-11-22 16:39:44 +0000
commita1a074b6b322dc645c49948f79f7960308978b2f (patch)
tree8749168ecb1e9fa530996b26a2b5088675fd8c90 /sys/sparc64/fhc/fhc_nexus.c
parentbba6f0a901e05837ff4081a218f12d166b5f486c (diff)
downloadsrc-a1a074b6b322dc645c49948f79f7960308978b2f.tar.gz
src-a1a074b6b322dc645c49948f79f7960308978b2f.zip
- Convert these bus drivers to make use of the newly introduced set of
ofw_bus_gen_get_*() for providing the ofw_bus KOBJ interface in order to reduce code duplication. - While here sync the various sparc64 bus drivers a bit (handle failure to attach a child gracefully instead of panicing, move the printing of child resources common to bus_print_child() and bus_probe_nomatch() implementations of a bus into a <bus>_print_res() function, ...) and fix some minor bugs and nits (plug memory leaks present when attaching a bus or child device fails, remove unused struct members, ...). Additional testing by: kris (central(4) and fhc(4))
Notes
Notes: svn path=/head/; revision=152684
Diffstat (limited to 'sys/sparc64/fhc/fhc_nexus.c')
-rw-r--r--sys/sparc64/fhc/fhc_nexus.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/sparc64/fhc/fhc_nexus.c b/sys/sparc64/fhc/fhc_nexus.c
index c6c286005387..705c5c3dfb70 100644
--- a/sys/sparc64/fhc/fhc_nexus.c
+++ b/sys/sparc64/fhc/fhc_nexus.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
#include <dev/ofw/openfirm.h>
#include <machine/bus.h>
@@ -68,11 +69,12 @@ static device_method_t fhc_nexus_methods[] = {
DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource),
/* ofw_bus interface */
- DEVMETHOD(ofw_bus_get_compat, fhc_get_compat),
- DEVMETHOD(ofw_bus_get_model, fhc_get_model),
- DEVMETHOD(ofw_bus_get_name, fhc_get_name),
- DEVMETHOD(ofw_bus_get_node, fhc_get_node),
- DEVMETHOD(ofw_bus_get_type, fhc_get_type),
+ DEVMETHOD(ofw_bus_get_devinfo, fhc_get_devinfo),
+ DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat),
+ DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model),
+ DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name),
+ DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node),
+ DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type),
{ NULL, NULL }
};