dmaengine: pxa: deprecate '#dma-channels' and '#dma-requests'
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 3 May 2022 06:54:05 +0000 (08:54 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 19 May 2022 17:23:46 +0000 (22:53 +0530)
The generic properties, used in most of the drivers and defined in
generic dma-common DT bindings, are 'dma-channels' and 'dma-requests'.
Switch to new properties while keeping backward compatibility.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220503065407.52188-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/pxa_dma.c

index 6078cc8..e7034f6 100644 (file)
@@ -1365,10 +1365,17 @@ static int pxad_probe(struct platform_device *op)
 
        of_id = of_match_device(pxad_dt_ids, &op->dev);
        if (of_id) {
-               of_property_read_u32(op->dev.of_node, "#dma-channels",
-                                    &dma_channels);
-               ret = of_property_read_u32(op->dev.of_node, "#dma-requests",
+               /* Parse new and deprecated dma-channels properties */
+               if (of_property_read_u32(op->dev.of_node, "dma-channels",
+                                        &dma_channels))
+                       of_property_read_u32(op->dev.of_node, "#dma-channels",
+                                            &dma_channels);
+               /* Parse new and deprecated dma-requests properties */
+               ret = of_property_read_u32(op->dev.of_node, "dma-requests",
                                           &nb_requestors);
+               if (ret)
+                       ret = of_property_read_u32(op->dev.of_node, "#dma-requests",
+                                                  &nb_requestors);
                if (ret) {
                        dev_warn(pdev->slave.dev,
                                 "#dma-requests set to default 32 as missing in OF: %d",