Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha/pci Share some attention with apecs(4).
details: https://anonhg.NetBSD.org/src/rev/ad6fd48856b6
branches: trunk
changeset: 753993:ad6fd48856b6
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Thu Apr 15 13:02:13 2010 +0000
description:
Share some attention with apecs(4).
- Convert to CFATTACH_DECL_NEW().
- Sprinkle static on functions.
- Recycle now-empty-and/or-unused softc structures.
diffstat:
sys/arch/alpha/pci/apecs.c | 28 +++++++++++++---------------
sys/arch/alpha/pci/apecsvar.h | 8 +-------
2 files changed, 14 insertions(+), 22 deletions(-)
diffs (102 lines):
diff -r a5587c99080c -r ad6fd48856b6 sys/arch/alpha/pci/apecs.c
--- a/sys/arch/alpha/pci/apecs.c Thu Apr 15 12:35:57 2010 +0000
+++ b/sys/arch/alpha/pci/apecs.c Thu Apr 15 13:02:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apecs.c,v 1.49 2009/03/14 21:04:02 dsl Exp $ */
+/* $NetBSD: apecs.c,v 1.50 2010/04/15 13:02:13 jakllsch Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: apecs.c,v 1.49 2009/03/14 21:04:02 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apecs.c,v 1.50 2010/04/15 13:02:13 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -97,23 +97,22 @@
#include <alpha/pci/pci_1000.h>
#endif
-int apecsmatch(struct device *, struct cfdata *, void *);
-void apecsattach(struct device *, struct device *, void *);
+static int apecsmatch(device_t, cfdata_t, void *);
+static void apecsattach(device_t, device_t, void *);
-CFATTACH_DECL(apecs, sizeof(struct apecs_softc),
- apecsmatch, apecsattach, NULL, NULL);
+CFATTACH_DECL_NEW(apecs, 0, apecsmatch, apecsattach, NULL, NULL);
extern struct cfdriver apecs_cd;
-int apecs_bus_get_window(int, int,
- struct alpha_bus_space_translation *);
+static int apecs_bus_get_window(int, int,
+ struct alpha_bus_space_translation *);
/* There can be only one. */
int apecsfound;
struct apecs_config apecs_configuration;
-int
-apecsmatch(struct device *parent, struct cfdata *match, void *aux)
+static int
+apecsmatch(device_t parent, cfdata_t match, void *aux)
{
struct mainbus_attach_args *ma = aux;
@@ -163,10 +162,9 @@
acp->ac_initted = 1;
}
-void
-apecsattach(struct device *parent, struct device *self, void *aux)
+static void
+apecsattach(device_t parent, device_t self, void *aux)
{
- struct apecs_softc *sc = (struct apecs_softc *)self;
struct apecs_config *acp;
struct pcibus_attach_args pba;
@@ -177,7 +175,7 @@
* set up the chipset's info; done once at console init time
* (maybe), but doesn't hurt to do twice.
*/
- acp = sc->sc_acp = &apecs_configuration;
+ acp = &apecs_configuration;
apecs_init(acp, 1);
apecs_dma_init(acp);
@@ -237,7 +235,7 @@
config_found_ia(self, "pcibus", &pba, pcibusprint);
}
-int
+static int
apecs_bus_get_window(int type, int window, struct alpha_bus_space_translation *abst)
{
struct apecs_config *acp = &apecs_configuration;
diff -r a5587c99080c -r ad6fd48856b6 sys/arch/alpha/pci/apecsvar.h
--- a/sys/arch/alpha/pci/apecsvar.h Thu Apr 15 12:35:57 2010 +0000
+++ b/sys/arch/alpha/pci/apecsvar.h Thu Apr 15 13:02:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apecsvar.h,v 1.9 2009/03/14 14:45:53 dsl Exp $ */
+/* $NetBSD: apecsvar.h,v 1.10 2010/04/15 13:02:13 jakllsch Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -58,12 +58,6 @@
int ac_mallocsafe;
};
-struct apecs_softc {
- struct device sc_dev;
-
- struct apecs_config *sc_acp;
-};
-
void apecs_init(struct apecs_config *, int);
void apecs_pci_init(pci_chipset_tag_t, void *);
void apecs_dma_init(struct apecs_config *);
Home |
Main Index |
Thread Index |
Old Index