lkml.org 
[lkml]   [2020]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v3 03/16] spi: dw: Discard static DW DMA slave structures
    On Thu, May 21, 2020 at 4:23 AM Serge Semin
    <Sergey.Semin@baikalelectronics.ru> wrote:
    >
    > Having them declared is redundant since each struct dw_dma_chan has
    > the same structure embedded and the structure from the passed dma_chan
    > private pointer will be copied there as a result of the next calls
    > chain:
    > dma_request_channel() -> find_candidate() -> dma_chan_get() ->
    > device_alloc_chan_resources() = dwc_alloc_chan_resources() ->
    > dw_dma_filter().
    > So just remove the static dw_dma_chan structures and use a locally
    > declared data instance with dst_id/src_id set to the same values as
    > the static copies used to have.

    ...

    > - Explicitly initialize the dw_dma_slave members on stack.

    Thanks for an update, but that's not what I asked for...

    > -static struct dw_dma_slave mid_dma_tx = { .dst_id = 1 };
    > -static struct dw_dma_slave mid_dma_rx = { .src_id = 0 };

    > static int mid_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
    > {
    > + struct dw_dma_slave slave = {
    > + .src_id = 0,
    > + .dst_id = 0
    > + };

    (It's member, and not memberS)

    > - struct dw_dma_slave *tx = dws->dma_tx;
    > - struct dw_dma_slave *rx = dws->dma_rx;

    May we simple do

    struct dw_dma_slave tx = { .dst_id = 1 };
    struct dw_dma_slave rx = { .src_id = 0 };

    please?

    --
    With Best Regards,
    Andy Shevchenko

    \
     
     \ /
      Last update: 2020-05-21 11:58    [W:4.236 / U:0.164 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site