diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-05-09 22:33:55 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-05-09 22:33:55 +0000 |
commit | 15cd6a42ff78f176a0db39dfa7401274f1792bfc (patch) | |
tree | 69a950d47edcd44df04df75de2fe47d28c886f8c /sys/arch/palm/dev | |
parent | a9b23f00f1cdf8ec5565371412b53af1247703da (diff) |
Refactor queue allocation and initialization into a wdc_alloc_queue()
function, and let attachment code calls this rather than malloc(9).
This prevents re-initialization of the queue in shared queue chipsets.
Also, add wdc_free_queue() as a complementary function.
Earlier version (without wdc_free_queue()) tested by sthen@ and Amit
Kulkarni on various pciide(4) chips.
ok dlg@
Diffstat (limited to 'sys/arch/palm/dev')
-rw-r--r-- | sys/arch/palm/dev/palm_hdd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/palm/dev/palm_hdd.c b/sys/arch/palm/dev/palm_hdd.c index 708c7cca850..dda926f1d0e 100644 --- a/sys/arch/palm/dev/palm_hdd.c +++ b/sys/arch/palm/dev/palm_hdd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: palm_hdd.c,v 1.2 2009/09/09 11:30:56 marex Exp $ */ +/* $OpenBSD: palm_hdd.c,v 1.3 2011/05/09 22:33:54 matthew Exp $ */ /* * Copyright (c) 2009 Marek Vasut <marex@openbsd.org> @@ -88,7 +88,7 @@ void palm_hdd_attach(struct device *parent, struct device *self, void *aux) chp->channel = 0; chp->wdc = &sc->sc_wdcdev; - chp->ch_queue = malloc(sizeof(struct channel_queue), M_DEVBUF, M_NOWAIT); + chp->ch_queue = wdc_alloc_queue(); printf("\n"); |