diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/dmaengine.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 1419a5094478..d6b6bff355f4 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -113,7 +113,7 @@ struct dma_chan_percpu { | |||
113 | * @device: ptr to the dma device who supplies this channel, always !%NULL | 113 | * @device: ptr to the dma device who supplies this channel, always !%NULL |
114 | * @cookie: last cookie value returned to client | 114 | * @cookie: last cookie value returned to client |
115 | * @chan_id: channel ID for sysfs | 115 | * @chan_id: channel ID for sysfs |
116 | * @class_dev: class device for sysfs | 116 | * @dev: class device for sysfs |
117 | * @refcount: kref, used in "bigref" slow-mode | 117 | * @refcount: kref, used in "bigref" slow-mode |
118 | * @slow_ref: indicates that the DMA channel is free | 118 | * @slow_ref: indicates that the DMA channel is free |
119 | * @rcu: the DMA channel's RCU head | 119 | * @rcu: the DMA channel's RCU head |
@@ -128,7 +128,7 @@ struct dma_chan { | |||
128 | 128 | ||
129 | /* sysfs */ | 129 | /* sysfs */ |
130 | int chan_id; | 130 | int chan_id; |
131 | struct device dev; | 131 | struct dma_chan_dev *dev; |
132 | 132 | ||
133 | struct list_head device_node; | 133 | struct list_head device_node; |
134 | struct dma_chan_percpu *local; | 134 | struct dma_chan_percpu *local; |
@@ -136,7 +136,20 @@ struct dma_chan { | |||
136 | int table_count; | 136 | int table_count; |
137 | }; | 137 | }; |
138 | 138 | ||
139 | #define to_dma_chan(p) container_of(p, struct dma_chan, dev) | 139 | /** |
140 | * struct dma_chan_dev - relate sysfs device node to backing channel device | ||
141 | * @chan - driver channel device | ||
142 | * @device - sysfs device | ||
143 | */ | ||
144 | struct dma_chan_dev { | ||
145 | struct dma_chan *chan; | ||
146 | struct device device; | ||
147 | }; | ||
148 | |||
149 | static inline const char *dma_chan_name(struct dma_chan *chan) | ||
150 | { | ||
151 | return dev_name(&chan->dev->device); | ||
152 | } | ||
140 | 153 | ||
141 | void dma_chan_cleanup(struct kref *kref); | 154 | void dma_chan_cleanup(struct kref *kref); |
142 | 155 | ||