diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-12-31 23:03:59 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-12-31 23:03:59 +0000 |
commit | bfbe65b646562fd352763d22e5211578e474fadb (patch) | |
tree | 97e5c76a1481934b32322b59706118ca33a74252 | |
parent | dc8ab3597e9a96baa21099b6ac3032c72d112134 (diff) |
Search for the devices to attach to mainbus, not hardcoded. ok miod@
-rw-r--r-- | sys/arch/arm/mainbus/mainbus.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sys/arch/arm/mainbus/mainbus.c b/sys/arch/arm/mainbus/mainbus.c index f527313ec5b..d9378a3038c 100644 --- a/sys/arch/arm/mainbus/mainbus.c +++ b/sys/arch/arm/mainbus/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.2 2004/05/19 03:17:07 drahn Exp $ */ +/* $OpenBSD: mainbus.c,v 1.3 2005/12/31 23:03:58 drahn Exp $ */ /* $NetBSD: mainbus.c,v 1.3 2001/06/13 17:52:43 nathanw Exp $ */ /* @@ -71,7 +71,7 @@ extern struct bus_space mainbus_bs_tag; int mainbusmatch (struct device *, void *, void *); void mainbusattach (struct device *, struct device *, void *); int mainbusprint (void *aux, const char *mainbus); -int mainbussearch (struct device *, struct cfdata *, void *); +int mainbussearch (struct device *, void *, void *); /* attach and device structures for the device */ @@ -104,15 +104,24 @@ mainbusmatch(struct device *parent, void *cf, void *aux) void mainbusattach(struct device *parent, struct device *self, void *aux) { - struct mainbus_attach_args ma; printf("\n"); + config_search(mainbussearch, self, self); +} + +int +mainbussearch(struct device *parent, void *c, void *aux) +{ + struct mainbus_attach_args ma; + struct cfdata *cf = c; + + ma.ma_iot = &mainbus_bs_tag; - ma.ma_name = "cpu"; - config_found(self, &ma, mainbusprint); /* XXX */ - ma.ma_iot = &mainbus_bs_tag; - ma.ma_name = "footbridge"; - config_found(self, &ma, mainbusprint); /* XXX */ + ma.ma_name = cf->cf_driver->cd_name; + + config_found(parent, &ma, mainbusprint); + + return 1; } /* |