diff options
author | Baolin Wang <baolin.wang@linaro.org> | 2019-05-20 07:32:16 -0400 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2019-05-27 01:53:52 -0400 |
commit | 990c0b53bf6599a9c9c7df1529dde681dee6cf64 (patch) | |
tree | 0025b221e849ed2d035268f3e786828737c311ff | |
parent | 37c0afeb41f1c6061b8c5fec1eeec36117bd1193 (diff) |
dmaengine: imx-sdma: Let the core do the device node validation
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>
-rw-r--r-- | drivers/dma/imx-sdma.c | 9 | ||||
-rw-r--r-- | include/linux/platform_data/dma-imx.h | 1 |
2 files changed, 2 insertions, 8 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 99d9f431ae2c..ca296f0849ef 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -1934,16 +1934,11 @@ disable_clk_ipg: | |||
1934 | static bool sdma_filter_fn(struct dma_chan *chan, void *fn_param) | 1934 | static bool sdma_filter_fn(struct dma_chan *chan, void *fn_param) |
1935 | { | 1935 | { |
1936 | struct sdma_channel *sdmac = to_sdma_chan(chan); | 1936 | struct sdma_channel *sdmac = to_sdma_chan(chan); |
1937 | struct sdma_engine *sdma = sdmac->sdma; | ||
1938 | struct imx_dma_data *data = fn_param; | 1937 | struct imx_dma_data *data = fn_param; |
1939 | 1938 | ||
1940 | if (!imx_dma_is_general_purpose(chan)) | 1939 | if (!imx_dma_is_general_purpose(chan)) |
1941 | return false; | 1940 | return false; |
1942 | 1941 | ||
1943 | /* return false if it's not the right device */ | ||
1944 | if (sdma->dev->of_node != data->of_node) | ||
1945 | return false; | ||
1946 | |||
1947 | sdmac->data = *data; | 1942 | sdmac->data = *data; |
1948 | chan->private = &sdmac->data; | 1943 | chan->private = &sdmac->data; |
1949 | 1944 | ||
@@ -1971,9 +1966,9 @@ static struct dma_chan *sdma_xlate(struct of_phandle_args *dma_spec, | |||
1971 | * be set to sdmac->event_id1. | 1966 | * be set to sdmac->event_id1. |
1972 | */ | 1967 | */ |
1973 | data.dma_request2 = 0; | 1968 | data.dma_request2 = 0; |
1974 | data.of_node = ofdma->of_node; | ||
1975 | 1969 | ||
1976 | return dma_request_channel(mask, sdma_filter_fn, &data); | 1970 | return __dma_request_channel(&mask, sdma_filter_fn, &data, |
1971 | ofdma->of_node); | ||
1977 | } | 1972 | } |
1978 | 1973 | ||
1979 | static int sdma_probe(struct platform_device *pdev) | 1974 | static int sdma_probe(struct platform_device *pdev) |
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h index 9daea8d42a10..7d964e787299 100644 --- a/include/linux/platform_data/dma-imx.h +++ b/include/linux/platform_data/dma-imx.h | |||
@@ -55,7 +55,6 @@ struct imx_dma_data { | |||
55 | int dma_request2; /* secondary DMA request line */ | 55 | int dma_request2; /* secondary DMA request line */ |
56 | enum sdma_peripheral_type peripheral_type; | 56 | enum sdma_peripheral_type peripheral_type; |
57 | int priority; | 57 | int priority; |
58 | struct device_node *of_node; | ||
59 | }; | 58 | }; |
60 | 59 | ||
61 | static inline int imx_dma_is_ipu(struct dma_chan *chan) | 60 | static inline int imx_dma_is_ipu(struct dma_chan *chan) |