diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2022-05-03 08:54:06 +0200 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2022-05-19 22:53:46 +0530 |
commit | 607c04a0441ff477666dca4744e94f555aa8fd65 (patch) | |
tree | b7e81104e589d0eaaf30a814a81d91dedd36a34e /drivers/dma | |
parent | d9cb0a4c0be595b55e30cf8774d3e92ab38bca5b (diff) | |
download | lwn-607c04a0441ff477666dca4744e94f555aa8fd65.tar.gz lwn-607c04a0441ff477666dca4744e94f555aa8fd65.zip |
dmaengine: mmp: deprecate '#dma-channels'
The generic property, used in most of the drivers and defined in generic
dma-common DT bindings, is 'dma-channels'. Switch to new property while
keeping backward compatibility.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220503065407.52188-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/mmp_pdma.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index 5a53d7fcef01..e8d71b35593e 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -1043,13 +1043,17 @@ static int mmp_pdma_probe(struct platform_device *op) return PTR_ERR(pdev->base); of_id = of_match_device(mmp_pdma_dt_ids, pdev->dev); - if (of_id) - of_property_read_u32(pdev->dev->of_node, "#dma-channels", - &dma_channels); - else if (pdata && pdata->dma_channels) + if (of_id) { + /* Parse new and deprecated dma-channels properties */ + if (of_property_read_u32(pdev->dev->of_node, "dma-channels", + &dma_channels)) + of_property_read_u32(pdev->dev->of_node, "#dma-channels", + &dma_channels); + } else if (pdata && pdata->dma_channels) { dma_channels = pdata->dma_channels; - else + } else { dma_channels = 32; /* default 32 channel */ + } pdev->dma_channels = dma_channels; for (i = 0; i < dma_channels; i++) { |