Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sdmmc If necessary, unload and destroy dmamap upon d...



details:   https://anonhg.NetBSD.org/src/rev/6f186cdb992c
branches:  trunk
changeset: 780118:6f186cdb992c
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Thu Jul 12 16:01:53 2012 +0000

description:
If necessary, unload and destroy dmamap upon detach.

diffstat:

 sys/dev/sdmmc/sdmmc.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r d91366820277 -r 6f186cdb992c sys/dev/sdmmc/sdmmc.c
--- a/sys/dev/sdmmc/sdmmc.c     Thu Jul 12 15:59:32 2012 +0000
+++ b/sys/dev/sdmmc/sdmmc.c     Thu Jul 12 16:01:53 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc.c,v 1.12 2012/02/01 22:34:42 matt Exp $  */
+/*     $NetBSD: sdmmc.c,v 1.13 2012/07/12 16:01:53 jakllsch Exp $      */
 /*     $OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $  */
 
 /*
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.12 2012/02/01 22:34:42 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.13 2012/07/12 16:01:53 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -192,6 +192,12 @@
        error = config_detach_children(self, flags);
        if (error)
                return error;
+
+       if (ISSET(sc->sc_caps, SMC_CAPS_DMA)) {
+               bus_dmamap_unload(sc->sc_dmat, sc->sc_dmap);
+               bus_dmamap_destroy(sc->sc_dmat, sc->sc_dmap);
+       }
+
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index