diff options
| author | thorpej <thorpej@NetBSD.org> | 2003-12-31 02:45:04 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2003-12-31 02:45:04 +0000 |
| commit | 2dafabdb205f22a99ed0d3daecea89ae471c5ca4 (patch) | |
| tree | a414e78c6f437ecc34fa287987f147c76bc02dbf /sys/arch/atari | |
| parent | b5b951b13e618fd011caa52d924576898900ee60 (diff) | |
Simplfy allocation of the channel queue.
Diffstat (limited to 'sys/arch/atari')
| -rw-r--r-- | sys/arch/atari/dev/wdc_mb.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sys/arch/atari/dev/wdc_mb.c b/sys/arch/atari/dev/wdc_mb.c index 34ee58ca8f9..be6bed3ae86 100644 --- a/sys/arch/atari/dev/wdc_mb.c +++ b/sys/arch/atari/dev/wdc_mb.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc_mb.c,v 1.16 2003/12/16 14:07:20 he Exp $ */ +/* $NetBSD: wdc_mb.c,v 1.17 2003/12/31 02:45:04 thorpej Exp $ */ /*- * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.16 2003/12/16 14:07:20 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.17 2003/12/31 02:45:04 thorpej Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -72,8 +72,9 @@ static void write_multi_2_swap __P((bus_space_tag_t, bus_space_handle_t, struct wdc_mb_softc { struct wdc_softc sc_wdcdev; - struct channel_softc *wdc_chanptr; + struct channel_softc wdc_chanlist[1]; struct channel_softc wdc_channel; + struct channel_queue wdc_chqueue; void *sc_ih; }; @@ -174,18 +175,12 @@ wdc_mb_attach(parent, self, aux) sc->sc_wdcdev.PIO_cap = 0; sc->sc_wdcdev.claim_hw = &claim_hw; sc->sc_wdcdev.free_hw = &free_hw; - sc->wdc_chanptr = &sc->wdc_channel; - sc->sc_wdcdev.channels = &sc->wdc_chanptr; + sc->wdc_chanlist[0] = &sc->wdc_channel; + sc->sc_wdcdev.channels = sc->wdc_chanlist; sc->sc_wdcdev.nchannels = 1; sc->wdc_channel.channel = 0; sc->wdc_channel.wdc = &sc->sc_wdcdev; - sc->wdc_channel.ch_queue = malloc(sizeof(struct channel_queue), - M_DEVBUF, M_NOWAIT); - if (sc->wdc_channel.ch_queue == NULL) { - printf("%s: can't allocate memory for command queue", - sc->sc_wdcdev.sc_dev.dv_xname); - return; - } + sc->wdc_channel.ch_queue = &sc->wdc_chqueue; /* * Setup & enable disk related interrupts. |
