Commit 96b3bb18 authored by Peter Harliman Liem's avatar Peter Harliman Liem Committed by Vinod Koul

dmaengine: lgm: Move DT parsing after initialization

ldma_cfg_init() will parse DT to retrieve certain configs.
However, that is called before ldma_dma_init_vXX(), which
will make some initialization to channel configs. It will
thus incorrectly overwrite certain configs that are declared
in DT.

To fix that, we move DT parsing after initialization.
Function name is renamed to better represent what it does.

Fixes: 32d31c79 ("dmaengine: Add Intel LGM SoC DMA support.")
Signed-off-by: default avatarPeter Harliman Liem <pliem@maxlinear.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/afef6fc1ed20098b684e0d53737d69faf63c125f.1672887183.git.pliem@maxlinear.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent f96a483f
...@@ -914,7 +914,7 @@ static void ldma_dev_init(struct ldma_dev *d) ...@@ -914,7 +914,7 @@ static void ldma_dev_init(struct ldma_dev *d)
} }
} }
static int ldma_cfg_init(struct ldma_dev *d) static int ldma_parse_dt(struct ldma_dev *d)
{ {
struct fwnode_handle *fwnode = dev_fwnode(d->dev); struct fwnode_handle *fwnode = dev_fwnode(d->dev);
struct ldma_port *p; struct ldma_port *p;
...@@ -1661,10 +1661,6 @@ static int intel_ldma_probe(struct platform_device *pdev) ...@@ -1661,10 +1661,6 @@ static int intel_ldma_probe(struct platform_device *pdev)
p->ldev = d; p->ldev = d;
} }
ret = ldma_cfg_init(d);
if (ret)
return ret;
dma_dev->dev = &pdev->dev; dma_dev->dev = &pdev->dev;
ch_mask = (unsigned long)d->channels_mask; ch_mask = (unsigned long)d->channels_mask;
...@@ -1675,6 +1671,10 @@ static int intel_ldma_probe(struct platform_device *pdev) ...@@ -1675,6 +1671,10 @@ static int intel_ldma_probe(struct platform_device *pdev)
ldma_dma_init_v3X(j, d); ldma_dma_init_v3X(j, d);
} }
ret = ldma_parse_dt(d);
if (ret)
return ret;
dma_dev->device_alloc_chan_resources = ldma_alloc_chan_resources; dma_dev->device_alloc_chan_resources = ldma_alloc_chan_resources;
dma_dev->device_free_chan_resources = ldma_free_chan_resources; dma_dev->device_free_chan_resources = ldma_free_chan_resources;
dma_dev->device_terminate_all = ldma_terminate_all; dma_dev->device_terminate_all = ldma_terminate_all;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment