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

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>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
607c04a0 d9cb0a4c

+9 -5
+9 -5
drivers/dma/mmp_pdma.c
··· 1043 1043 return PTR_ERR(pdev->base); 1044 1044 1045 1045 of_id = of_match_device(mmp_pdma_dt_ids, pdev->dev); 1046 - if (of_id) 1047 - of_property_read_u32(pdev->dev->of_node, "#dma-channels", 1048 - &dma_channels); 1049 - else if (pdata && pdata->dma_channels) 1046 + if (of_id) { 1047 + /* Parse new and deprecated dma-channels properties */ 1048 + if (of_property_read_u32(pdev->dev->of_node, "dma-channels", 1049 + &dma_channels)) 1050 + of_property_read_u32(pdev->dev->of_node, "#dma-channels", 1051 + &dma_channels); 1052 + } else if (pdata && pdata->dma_channels) { 1050 1053 dma_channels = pdata->dma_channels; 1051 - else 1054 + } else { 1052 1055 dma_channels = 32; /* default 32 channel */ 1056 + } 1053 1057 pdev->dma_channels = dma_channels; 1054 1058 1055 1059 for (i = 0; i < dma_channels; i++) {