Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/tsarm Clean up autoconf stuff



details:   https://anonhg.NetBSD.org/src/rev/9507ec5c8f11
branches:  trunk
changeset: 572237:9507ec5c8f11
user:      joff <joff%NetBSD.org@localhost>
date:      Mon Dec 27 02:42:49 2004 +0000

description:
Clean up autoconf stuff

diffstat:

 sys/arch/evbarm/tsarm/tspld.c |  42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diffs (95 lines):

diff -r 6c753da094aa -r 9507ec5c8f11 sys/arch/evbarm/tsarm/tspld.c
--- a/sys/arch/evbarm/tsarm/tspld.c     Mon Dec 27 02:41:54 2004 +0000
+++ b/sys/arch/evbarm/tsarm/tspld.c     Mon Dec 27 02:42:49 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tspld.c,v 1.2 2004/12/26 22:02:11 joff Exp $   */
+/*     $NetBSD: tspld.c,v 1.3 2004/12/27 02:42:49 joff Exp $   */
 
 /*-
  * Copyright (c) 2004 Jesse Off
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tspld.c,v 1.2 2004/12/26 22:02:11 joff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tspld.c,v 1.3 2004/12/27 02:42:49 joff Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,6 +62,8 @@
 void   tspldattach __P((struct device *, struct device *, void *));
 static int     tspld_wdog_setmode __P((struct sysmon_wdog *));
 static int     tspld_wdog_tickle __P((struct sysmon_wdog *));
+int tspld_search __P((struct device *, struct cfdata *, void *));
+int tspld_print __P((void *, const char *));
 
 struct tspld_softc {
         struct device           sc_dev;
@@ -71,7 +73,6 @@
        struct sysmon_wdog      sc_wdog;
 };
 
-
 CFATTACH_DECL(tspld, sizeof(struct tspld_softc),
     tspldmatch, tspldattach, NULL, NULL);
 
@@ -94,7 +95,6 @@
 {
        int     i, rev, features, jp, model;
        struct tspld_softc *sc = (struct tspld_softc *)self;
-       struct tspld_attach_args ta;
        bus_space_handle_t      ioh;
 
        sc->sc_iot = &ep93xx_bs_tag;
@@ -162,13 +162,36 @@
        sysmon_wdog_register(&sc->sc_wdog);
        tspld_wdog_setmode(&sc->sc_wdog);
 
-       ta.ta_iot = sc->sc_iot;
-       config_found_ia(self, "tspldbus", &ta, NULL);
-                       
        /* Set the on board peripherals bus callback */
        config_defer(self, tspld_callback);
 }
 
+int
+tspld_search(parent, cf, aux)
+       struct device *parent;
+       struct cfdata *cf;
+       void *aux;
+{
+       struct tspld_softc *sc = (struct tspld_softc *)parent;
+       struct tspld_attach_args sa;
+
+       sa.ta_iot = sc->sc_iot;
+
+       if (config_match(parent, cf, &sa) > 0)
+               config_attach(parent, cf, &sa, tspld_print);
+
+       return (0);
+}
+
+int
+tspld_print(aux, name)
+       void *aux;
+       const char *name;
+{
+
+       return (UNCONF);
+}
+
 void
 tspld_callback(self)
        struct device *self;
@@ -184,6 +207,11 @@
        iba.iba_memt = &isa_mem_bs_tag;
        config_found_ia(self, "isabus", &iba, isabusprint);
 #endif
+       /*
+        *  Attach each devices
+        */
+       config_search(tspld_search, self, NULL);
+       
 }
 
 static int



Home | Main Index | Thread Index | Old Index