Module Name: src Committed By: jakllsch Date: Thu Apr 15 13:02:13 UTC 2010
Modified Files: src/sys/arch/alpha/pci: apecs.c apecsvar.h Log Message: Share some attention with apecs(4). - Convert to CFATTACH_DECL_NEW(). - Sprinkle static on functions. - Recycle now-empty-and/or-unused softc structures. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/arch/alpha/pci/apecs.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/alpha/pci/apecsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/alpha/pci/apecs.c diff -u src/sys/arch/alpha/pci/apecs.c:1.49 src/sys/arch/alpha/pci/apecs.c:1.50 --- src/sys/arch/alpha/pci/apecs.c:1.49 Sat Mar 14 21:04:02 2009 +++ src/sys/arch/alpha/pci/apecs.c Thu Apr 15 13:02:13 2010 @@ -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; Index: src/sys/arch/alpha/pci/apecsvar.h diff -u src/sys/arch/alpha/pci/apecsvar.h:1.9 src/sys/arch/alpha/pci/apecsvar.h:1.10 --- src/sys/arch/alpha/pci/apecsvar.h:1.9 Sat Mar 14 14:45:53 2009 +++ src/sys/arch/alpha/pci/apecsvar.h Thu Apr 15 13:02:13 2010 @@ -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 *);