Thread (5 messages) flat view 5 messages, 3 authors, 2013-12-06

Re: [PATCH RFC v4 2/5] dma: mpc512x: add support for peripheral transfers

From: Alexander Popov <hidden>
Date: 2013-12-06 20:27:43

2013/10/6 Gerhard Sittig [off-list ref]:
On Thu, Oct 03, 2013 at 18:06 +0400, Alexander Popov wrote:
quoted
+
+             spin_lock_irqsave(&mchan->lock, flags);
+
+             if (cfg->direction == DMA_DEV_TO_MEM) {
Note that cfg->direction is of a different type than
DMA_DEV_TO_MEM (of different type than the 'direction' parameter
in the preparation routine) -- it's mere coincidence that the
numeric values happen to match at the moment.
Gerhard, it seems to me that this code is correct.
Cite from dmaengine.h:

  * struct dma_slave_config - dma slave channel runtime config
  * @direction: whether the data shall go in or out on this slave
  * channel, right now. DMA_TO_DEVICE and DMA_FROM_DEVICE are
  * legal values, DMA_BIDIRECTIONAL is not acceptable since we
  * need to differentiate source and target addresses.
  ...
  struct dma_slave_config {
          enum dma_transfer_direction direction;
          ...
  };

The comment above the definition is obsolete, isn't it?

Thanks
Alexander
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help