Re: [PATCH 2/4] dmaengine: Add STM32 DMA driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




 Hi Maxime,

2015-10-13 13:25 GMT+02:00 M'boumba Cedric Madianga <cedric.madianga@xxxxxxxxx>:

>>> +static int stm32_dma_set_xfer_param(struct stm32_dma_chan *chan,
>>> +                                   enum dma_transfer_direction direction,
>>> +                                   enum dma_slave_buswidth *buswidth)
>>> +{
>>> +       enum dma_slave_buswidth src_addr_width, dst_addr_width;
>>> +       u32 src_bus_width, dst_bus_width, src_burst_size, dst_burst_size;
>>> +       u32 src_maxburst, dst_maxburst;
>>> +       dma_addr_t src_addr, dst_addr;
>>> +
>>> +       src_addr_width = chan->dma_sconfig.src_addr_width;
>>> +       dst_addr_width = chan->dma_sconfig.dst_addr_width;
>>> +       src_maxburst = chan->dma_sconfig.src_maxburst;
>>> +       dst_maxburst = chan->dma_sconfig.dst_maxburst;
>>> +       src_addr = chan->dma_sconfig.src_addr;
>>> +       dst_addr = chan->dma_sconfig.dst_addr;
>>> +
>>> +       switch (direction) {
>>> +       case DMA_MEM_TO_DEV:
>>> +               dst_bus_width = stm32_get_dma_width(chan, dst_addr_width);
>>> +               if (dst_bus_width < 0)
>>> +                       return -EINVAL;
>>
>> dst_bus_width is a u32, so cannot be negative.
>> Also, you should propagate de error returned by stm32_get_dma_width().

> Good point. Thanks.
> I am going to replace u32 by int in the v2.
> It will be done in v2.
>
Finally, I prefer to return a default value from stm32_get_dma_width()
and stm32_get_dma_burst().
In that way, I will always be able to configure DMA transfer parameters.

BR,
Cedric
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux