diff options
author | Baolin Wang <baolin.wang@linaro.org> | 2019-05-20 07:32:18 -0400 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2019-05-27 01:53:52 -0400 |
commit | 1d967195fd456ae0e5425ee39611455de32dc9de (patch) | |
tree | cfc2b6000a0818f4fc3ddf01ca043ee968aa8ce8 /drivers/dma | |
parent | c88ba7b940f8ec9b50216a69db4ddfa1af58a98c (diff) |
dmaengine: mmp_tdma: 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>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/mmp_tdma.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 0c56faa03e9a..e76858b6b334 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c | |||
@@ -586,18 +586,12 @@ static int mmp_tdma_chan_init(struct mmp_tdma_device *tdev, | |||
586 | } | 586 | } |
587 | 587 | ||
588 | struct mmp_tdma_filter_param { | 588 | struct mmp_tdma_filter_param { |
589 | struct device_node *of_node; | ||
590 | unsigned int chan_id; | 589 | unsigned int chan_id; |
591 | }; | 590 | }; |
592 | 591 | ||
593 | static bool mmp_tdma_filter_fn(struct dma_chan *chan, void *fn_param) | 592 | static bool mmp_tdma_filter_fn(struct dma_chan *chan, void *fn_param) |
594 | { | 593 | { |
595 | struct mmp_tdma_filter_param *param = fn_param; | 594 | struct mmp_tdma_filter_param *param = fn_param; |
596 | struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan); | ||
597 | struct dma_device *pdma_device = tdmac->chan.device; | ||
598 | |||
599 | if (pdma_device->dev->of_node != param->of_node) | ||
600 | return false; | ||
601 | 595 | ||
602 | if (chan->chan_id != param->chan_id) | 596 | if (chan->chan_id != param->chan_id) |
603 | return false; | 597 | return false; |
@@ -615,13 +609,13 @@ static struct dma_chan *mmp_tdma_xlate(struct of_phandle_args *dma_spec, | |||
615 | if (dma_spec->args_count != 1) | 609 | if (dma_spec->args_count != 1) |
616 | return NULL; | 610 | return NULL; |
617 | 611 | ||
618 | param.of_node = ofdma->of_node; | ||
619 | param.chan_id = dma_spec->args[0]; | 612 | param.chan_id = dma_spec->args[0]; |
620 | 613 | ||
621 | if (param.chan_id >= TDMA_CHANNEL_NUM) | 614 | if (param.chan_id >= TDMA_CHANNEL_NUM) |
622 | return NULL; | 615 | return NULL; |
623 | 616 | ||
624 | return dma_request_channel(mask, mmp_tdma_filter_fn, ¶m); | 617 | return __dma_request_channel(&mask, mmp_tdma_filter_fn, ¶m, |
618 | ofdma->of_node); | ||
625 | } | 619 | } |
626 | 620 | ||
627 | static const struct of_device_id mmp_tdma_dt_ids[] = { | 621 | static const struct of_device_id mmp_tdma_dt_ids[] = { |