Date: Wed, 18 Feb 2009 21:12:48 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r188763 - head/sys/dev/ata Message-ID: <200902182112.n1ILCm4Q074866@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Feb 18 21:12:48 2009 New Revision: 188763 URL: http://svn.freebsd.org/changeset/base/188763 Log: Make ch->dma.free() called symmetrically to ch->dma.alloc(). Modified: head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-pci.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Wed Feb 18 20:42:42 2009 (r188762) +++ head/sys/dev/ata/ata-all.c Wed Feb 18 21:12:48 2009 (r188763) @@ -186,6 +186,11 @@ ata_detach(device_t dev) bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); ch->r_irq = NULL; + + /* free DMA resources if DMA HW present*/ + if (ch->dma.free) + ch->dma.free(dev); + mtx_destroy(&ch->state_mtx); mtx_destroy(&ch->queue_mtx); return 0; Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Wed Feb 18 20:42:42 2009 (r188762) +++ head/sys/dev/ata/ata-pci.c Wed Feb 18 21:12:48 2009 (r188763) @@ -544,14 +544,11 @@ ata_pcichannel_attach(device_t dev) static int ata_pcichannel_detach(device_t dev) { - struct ata_channel *ch = device_get_softc(dev); int error; if ((error = ata_detach(dev))) return error; - ch->dma.free(dev); - /* XXX SOS free resources for io and ctlio ?? */ return 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902182112.n1ILCm4Q074866>