summaryrefslogtreecommitdiff
path: root/sys/dev/mca/edc_mca.c
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2005-08-25 18:35:38 +0000
committerdrochner <drochner@NetBSD.org>2005-08-25 18:35:38 +0000
commitfa3cb84d6262bbf1db28e9d4d55ca3842a1d09e3 (patch)
tree11ffeefbbae1cf974abb0fbc0c79eaffe1f7a506 /sys/dev/mca/edc_mca.c
parentede55d75e5923dcb6b25383599fa8f9c8b8a36c0 (diff)
replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array the length in now known to all relevant parties, so this avoids duplication of information, and we can allocate that thing in drivers without hacks
Diffstat (limited to 'sys/dev/mca/edc_mca.c')
-rw-r--r--sys/dev/mca/edc_mca.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sys/dev/mca/edc_mca.c b/sys/dev/mca/edc_mca.c
index 62a8c2ee2e4..687af9ae459 100644
--- a/sys/dev/mca/edc_mca.c
+++ b/sys/dev/mca/edc_mca.c
@@ -1,4 +1,4 @@
-/* $NetBSD: edc_mca.c,v 1.28 2005/02/27 00:27:21 perry Exp $ */
+/* $NetBSD: edc_mca.c,v 1.29 2005/08/25 18:35:39 drochner Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.28 2005/02/27 00:27:21 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: edc_mca.c,v 1.29 2005/08/25 18:35:39 drochner Exp $");
#include "rnd.h"
@@ -153,11 +153,11 @@ edc_mca_probe(parent, match, aux)
static int
edcsubmatch(struct device *parent, struct cfdata *cf,
- const locdesc_t *ldesc, void *aux)
+ const locdesc_t *locs, void *aux)
{
if (cf->cf_loc[EDCCF_DRIVE] != EDCCF_DRIVE_DEFAULT &&
- cf->cf_loc[EDCCF_DRIVE] != ldesc->locs[EDCCF_DRIVE])
+ cf->cf_loc[EDCCF_DRIVE] != locs[EDCCF_DRIVE])
return (0);
return (config_match(parent, cf, aux));
@@ -175,8 +175,7 @@ edc_mca_attach(parent, self, aux)
int irq, drq, iobase;
const char *typestr;
int devno, error;
- int help[2];
- locdesc_t *ldesc = (void *)help; /* XXX */
+ int locs[EDCCF_NLOCS];
pos2 = mca_conf_read(ma->ma_mc, ma->ma_slot, 2);
pos3 = mca_conf_read(ma->ma_mc, ma->ma_slot, 3);
@@ -324,10 +323,9 @@ edc_mca_attach(parent, self, aux)
/* check for attached disks */
for (devno = 0; devno < sc->sc_maxdevs; devno++) {
eda.edc_drive = devno;
- ldesc->len = 1;
- ldesc->locs[EDCCF_DRIVE] = devno;
+ locs[EDCCF_DRIVE] = devno;
sc->sc_ed[devno] =
- (void *) config_found_sm_loc(self, "edc", ldesc, &eda,
+ (void *) config_found_sm_loc(self, "edc", locs, &eda,
NULL, edcsubmatch);
/* If initialization did not succeed, NULL the pointer. */