Skip to content

Commit 96b3bb1

Browse files
pliem-mxlvinodkoul
authored andcommitted
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: 32d31c7 ("dmaengine: Add Intel LGM SoC DMA support.") Signed-off-by: Peter Harliman Liem <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/afef6fc1ed20098b684e0d53737d69faf63c125f.1672887183.git.pliem@maxlinear.com Signed-off-by: Vinod Koul <[email protected]>
1 parent f96a483 commit 96b3bb1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/dma/lgm/lgm-dma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ static void ldma_dev_init(struct ldma_dev *d)
914914
}
915915
}
916916

917-
static int ldma_cfg_init(struct ldma_dev *d)
917+
static int ldma_parse_dt(struct ldma_dev *d)
918918
{
919919
struct fwnode_handle *fwnode = dev_fwnode(d->dev);
920920
struct ldma_port *p;
@@ -1661,10 +1661,6 @@ static int intel_ldma_probe(struct platform_device *pdev)
16611661
p->ldev = d;
16621662
}
16631663

1664-
ret = ldma_cfg_init(d);
1665-
if (ret)
1666-
return ret;
1667-
16681664
dma_dev->dev = &pdev->dev;
16691665

16701666
ch_mask = (unsigned long)d->channels_mask;
@@ -1675,6 +1671,10 @@ static int intel_ldma_probe(struct platform_device *pdev)
16751671
ldma_dma_init_v3X(j, d);
16761672
}
16771673

1674+
ret = ldma_parse_dt(d);
1675+
if (ret)
1676+
return ret;
1677+
16781678
dma_dev->device_alloc_chan_resources = ldma_alloc_chan_resources;
16791679
dma_dev->device_free_chan_resources = ldma_free_chan_resources;
16801680
dma_dev->device_terminate_all = ldma_terminate_all;

0 commit comments

Comments
 (0)