Commit b4bd07c2 authored by David S. Miller's avatar David S. Miller

net_dma: call dmaengine_get only if NET_DMA enabled

Based upon a patch from Atsushi Nemoto <anemo@mba.ocn.ne.jp>

--------------------
The commit 649274d9 ("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: default avatarDavid S. Miller <davem@davemloft.net>
Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 152abd13
...@@ -282,6 +282,18 @@ static inline void dmaengine_put(void) ...@@ -282,6 +282,18 @@ static inline void dmaengine_put(void)
} }
#endif #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, dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
void *dest, void *src, size_t len); void *dest, void *src, size_t len);
dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan, dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
......
...@@ -1090,7 +1090,7 @@ int dev_open(struct net_device *dev) ...@@ -1090,7 +1090,7 @@ int dev_open(struct net_device *dev)
/* /*
* Enable NET_DMA * Enable NET_DMA
*/ */
dmaengine_get(); net_dmaengine_get();
/* /*
* Initialize multicasting status * Initialize multicasting status
...@@ -1172,7 +1172,7 @@ int dev_close(struct net_device *dev) ...@@ -1172,7 +1172,7 @@ int dev_close(struct net_device *dev)
/* /*
* Shutdown NET_DMA * Shutdown NET_DMA
*/ */
dmaengine_put(); net_dmaengine_put();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment