]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
net_dma: call dmaengine_get only if NET_DMA enabled
authorDavid S. Miller <davem@davemloft.net>
Sat, 7 Feb 2009 06:06:43 +0000 (22:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 7 Feb 2009 06:06:43 +0000 (22:06 -0800)
Based upon a patch from Atsushi Nemoto <anemo@mba.ocn.ne.jp>

--------------------
The commit 649274d993212e7c23c0cb734572c2311c200872 ("net_dma:
acquire/release dma channels on ifup/ifdown") added unconditional call
of dmaengine_get() to net_dma.  The API should be called only if
NET_DMA was enabled.
--------------------

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Dan Williams <dan.j.williams@intel.com>
include/linux/dmaengine.h
net/core/dev.c

index 3e0f64c335c8d7252f048319204c1c0648f77fbf..3e68469c1885e3df7e7078b0c39aab5237cb7f06 100644 (file)
@@ -282,6 +282,18 @@ static inline void dmaengine_put(void)
 }
 #endif
 
+#ifdef CONFIG_NET_DMA
+#define net_dmaengine_get()    dmaengine_get()
+#define net_dmaengine_put()    dmaengine_put()
+#else
+static inline void net_dmaengine_get(void)
+{
+}
+static inline void net_dmaengine_put(void)
+{
+}
+#endif
+
 dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
        void *dest, void *src, size_t len);
 dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
index 5379b0c1190a86aa10ab8afd0ae4da9597af1611..a17e00662363ad04fc432fe08be012cd9433fb23 100644 (file)
@@ -1090,7 +1090,7 @@ int dev_open(struct net_device *dev)
                /*
                 *      Enable NET_DMA
                 */
-               dmaengine_get();
+               net_dmaengine_get();
 
                /*
                 *      Initialize multicasting status
@@ -1172,7 +1172,7 @@ int dev_close(struct net_device *dev)
        /*
         *      Shutdown NET_DMA
         */
-       dmaengine_put();
+       net_dmaengine_put();
 
        return 0;
 }