Tue Sep 15 02:34:03 2009 UTC ()
some code cleanup


(cliff)
diff -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_mainbus.c

cvs diff -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_mainbus.c (expand / switch to unified diff)

--- src/sys/arch/mips/rmi/rmixl_mainbus.c 2009/09/13 03:27:38 1.1.2.1
+++ src/sys/arch/mips/rmi/rmixl_mainbus.c 2009/09/15 02:34:03 1.1.2.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rmixl_mainbus.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ 1/* $NetBSD: rmixl_mainbus.c,v 1.1.2.2 2009/09/15 02:34:03 cliff Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994,1995 Mark Brinicombe. 4 * Copyright (c) 1994,1995 Mark Brinicombe.
5 * Copyright (c) 1994 Brini. 5 * Copyright (c) 1994 Brini.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -32,70 +32,63 @@ @@ -32,70 +32,63 @@
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 * 34 *
35 * RiscBSD kernel project 35 * RiscBSD kernel project
36 * 36 *
37 * mainbus.c 37 * mainbus.c
38 * 38 *
39 * mainbus configuration 39 * mainbus configuration
40 * 40 *
41 * Created : 15/12/94 41 * Created : 15/12/94
42 */ 42 */
43 43
44#include <sys/cdefs.h> 44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD: rmixl_mainbus.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $"); 45__KERNEL_RCSID(0, "$NetBSD: rmixl_mainbus.c,v 1.1.2.2 2009/09/15 02:34:03 cliff Exp $");
46 46
47#include <sys/param.h> 47#include <sys/param.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49#include <sys/kernel.h> 49#include <sys/kernel.h>
50#include <sys/conf.h> 50#include <sys/conf.h>
51#include <sys/malloc.h> 51#include <sys/malloc.h>
52#include <sys/device.h> 52#include <sys/device.h>
53 53
54#include <machine/bus.h> 54#include <machine/bus.h>
55#include "locators.h" 55#include "locators.h"
56 56
57static int mainbusmatch __P((struct device *, struct cfdata *, void *)); 57static int mainbusmatch(struct device *, struct cfdata *, void *);
58static void mainbusattach __P((struct device *, struct device *, void *)); 58static void mainbusattach(struct device *, struct device *, void *);
59static int mainbussearch __P((struct device *, struct cfdata *, 59static int mainbussearch(struct device *, struct cfdata *,
60 const int *, void *)); 60 const int *, void *);
61 61
62CFATTACH_DECL(mainbus, sizeof(struct device), 62CFATTACH_DECL(mainbus, sizeof(struct device),
63 mainbusmatch, mainbusattach, NULL, NULL); 63 mainbusmatch, mainbusattach, NULL, NULL);
64 64
65static int mainbus_found; 65static int mainbus_found;
66 66
67static int 67static int
68mainbusmatch(parent, cf, aux) 68mainbusmatch(struct device *parent, struct cfdata *cf, void *aux)
69 struct device *parent; 
70 struct cfdata *cf; 
71 void *aux; 
72{ 69{
73 if (mainbus_found) 70 if (mainbus_found)
74 return 0; 71 return 0;
75 return 1; 72 return 1;
76} 73}
77 74
78static int 75static int
79mainbussearch(parent, cf, ldesc, aux) 76mainbussearch(struct device *parent, struct cfdata *cf,
80 struct device *parent; 77 const int *ldesc, void *aux)
81 struct cfdata *cf; 
82 const int *ldesc; 
83 void *aux; 
84{ 78{
85 if (config_match(parent, cf, NULL) > 0) 79 if (config_match(parent, cf, NULL) > 0)
86 config_attach(parent, cf, aux, NULL); 80 config_attach(parent, cf, aux, NULL);
87 81
88 return 0; 82 return 0;
89} 83}
90 84
91static void 85static void
92mainbusattach(parent, self, aux) 86mainbusattach(struct device *parent, struct device *self, void *aux)
93 struct device *parent; 
94 struct device *self; 
95 void *aux; 
96{ 87{
97 aprint_naive("\n"); 88 aprint_naive("\n");
98 aprint_normal("\n"); 89 aprint_normal("\n");
99 90
 91 mainbus_found = 1;
 92
100 config_search_ia(mainbussearch, self, "mainbus", NULL); 93 config_search_ia(mainbussearch, self, "mainbus", NULL);
101} 94}