dmaengine: imx-sdma: Let the core do the device node validation
authorBaolin Wang <baolin.wang@linaro.org>
Mon, 20 May 2019 11:32:16 +0000 (19:32 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 27 May 2019 05:53:52 +0000 (11:23 +0530)
Let the DMA engine core do the device node validation instead of drivers.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/imx-sdma.c
include/linux/platform_data/dma-imx.h

index 99d9f43..ca296f0 100644 (file)
@@ -1934,16 +1934,11 @@ disable_clk_ipg:
 static bool sdma_filter_fn(struct dma_chan *chan, void *fn_param)
 {
        struct sdma_channel *sdmac = to_sdma_chan(chan);
-       struct sdma_engine *sdma = sdmac->sdma;
        struct imx_dma_data *data = fn_param;
 
        if (!imx_dma_is_general_purpose(chan))
                return false;
 
-       /* return false if it's not the right device */
-       if (sdma->dev->of_node != data->of_node)
-               return false;
-
        sdmac->data = *data;
        chan->private = &sdmac->data;
 
@@ -1971,9 +1966,9 @@ static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec,
         * be set to sdmac->event_id1.
         */
        data.dma_request2 = 0;
-       data.of_node = ofdma->of_node;
 
-       return dma_request_channel(mask, sdma_filter_fn, &data);
+       return __dma_request_channel(&mask, sdma_filter_fn, &data,
+                                    ofdma->of_node);
 }
 
 static int sdma_probe(struct platform_device *pdev)
index 9daea8d..7d964e7 100644 (file)
@@ -55,7 +55,6 @@ struct imx_dma_data {
        int dma_request2; /* secondary DMA request line */
        enum sdma_peripheral_type peripheral_type;
        int priority;
-       struct device_node *of_node;
 };
 
 static inline int imx_dma_is_ipu(struct dma_chan *chan)