Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 32d31c79a1a4 ("dmaengine: Add Intel LGM SoC DMA support.")
Signed-off-by: Peter Harliman Liem <pliem@maxlinear.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/afef6fc1ed20098b684e0d53737d69faf63c125f.1672887183.git.pliem@maxlinear.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Peter Harliman Liem and committed by
Vinod Koul
96b3bb18 f96a483f

+5 -5
+5 -5
drivers/dma/lgm/lgm-dma.c
··· 914 914 } 915 915 } 916 916 917 - static int ldma_cfg_init(struct ldma_dev *d) 917 + static int ldma_parse_dt(struct ldma_dev *d) 918 918 { 919 919 struct fwnode_handle *fwnode = dev_fwnode(d->dev); 920 920 struct ldma_port *p; ··· 1661 1661 p->ldev = d; 1662 1662 } 1663 1663 1664 - ret = ldma_cfg_init(d); 1665 - if (ret) 1666 - return ret; 1667 - 1668 1664 dma_dev->dev = &pdev->dev; 1669 1665 1670 1666 ch_mask = (unsigned long)d->channels_mask; ··· 1670 1674 else 1671 1675 ldma_dma_init_v3X(j, d); 1672 1676 } 1677 + 1678 + ret = ldma_parse_dt(d); 1679 + if (ret) 1680 + return ret; 1673 1681 1674 1682 dma_dev->device_alloc_chan_resources = ldma_alloc_chan_resources; 1675 1683 dma_dev->device_free_chan_resources = ldma_free_chan_resources;