aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/dmaengine.h21
-rw-r--r--include/net/netdma.h4
2 files changed, 2 insertions, 23 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index e4ec7e7b8056..d18d37d1015d 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -165,7 +165,6 @@ struct dma_slave {
165 */ 165 */
166 166
167struct dma_chan_percpu { 167struct dma_chan_percpu {
168 local_t refcount;
169 /* stats */ 168 /* stats */
170 unsigned long memcpy_count; 169 unsigned long memcpy_count;
171 unsigned long bytes_transferred; 170 unsigned long bytes_transferred;
@@ -205,26 +204,6 @@ struct dma_chan {
205 204
206void dma_chan_cleanup(struct kref *kref); 205void dma_chan_cleanup(struct kref *kref);
207 206
208static inline void dma_chan_get(struct dma_chan *chan)
209{
210 if (unlikely(chan->slow_ref))
211 kref_get(&chan->refcount);
212 else {
213 local_inc(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
214 put_cpu();
215 }
216}
217
218static inline void dma_chan_put(struct dma_chan *chan)
219{
220 if (unlikely(chan->slow_ref))
221 kref_put(&chan->refcount, dma_chan_cleanup);
222 else {
223 local_dec(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
224 put_cpu();
225 }
226}
227
228/* 207/*
229 * typedef dma_event_callback - function pointer to a DMA event callback 208 * typedef dma_event_callback - function pointer to a DMA event callback
230 * For each channel added to the system this routine is called for each client. 209 * For each channel added to the system this routine is called for each client.
diff --git a/include/net/netdma.h b/include/net/netdma.h
index f28c6e064e8f..cbe2737f4a61 100644
--- a/include/net/netdma.h
+++ b/include/net/netdma.h
@@ -27,11 +27,11 @@
27static inline struct dma_chan *get_softnet_dma(void) 27static inline struct dma_chan *get_softnet_dma(void)
28{ 28{
29 struct dma_chan *chan; 29 struct dma_chan *chan;
30
30 rcu_read_lock(); 31 rcu_read_lock();
31 chan = rcu_dereference(__get_cpu_var(softnet_data).net_dma); 32 chan = rcu_dereference(__get_cpu_var(softnet_data).net_dma);
32 if (chan)
33 dma_chan_get(chan);
34 rcu_read_unlock(); 33 rcu_read_unlock();
34
35 return chan; 35 return chan;
36} 36}
37 37