diff mbox series

[v2,2/3] dmaengine: sprd: deprecate '#dma-channels'

Message ID 20220503065147.51728-3-krzysztof.kozlowski@linaro.org (mailing list archive)
State Accepted
Commit d84c3ad998795503379ef8458ffffb5c06d18cc5
Headers show
Series dmaengine/ARM: sprd: use proper 'dma-channels/requests' properties | expand

Commit Message

Krzysztof Kozlowski May 3, 2022, 6:51 a.m. UTC
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>
---
 drivers/dma/sprd-dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Baolin Wang May 4, 2022, 2:28 a.m. UTC | #1
On Tue, May 3, 2022 at 2:51 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> 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>

Thanks.
Reviewed-by: Baolin Wang <baolin.wang7@gmail.com>

> ---
>  drivers/dma/sprd-dma.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
> index 7f158ef5672d..2138b80435ab 100644
> --- a/drivers/dma/sprd-dma.c
> +++ b/drivers/dma/sprd-dma.c
> @@ -1117,7 +1117,11 @@ static int sprd_dma_probe(struct platform_device *pdev)
>         u32 chn_count;
>         int ret, i;
>
> -       ret = device_property_read_u32(&pdev->dev, "#dma-channels", &chn_count);
> +       /* Parse new and deprecated dma-channels properties */
> +       ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count);
> +       if (ret)
> +               ret = device_property_read_u32(&pdev->dev, "#dma-channels",
> +                                              &chn_count);
>         if (ret) {
>                 dev_err(&pdev->dev, "get dma channels count failed\n");
>                 return ret;
> --
> 2.32.0
>
diff mbox series

Patch

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 7f158ef5672d..2138b80435ab 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1117,7 +1117,11 @@  static int sprd_dma_probe(struct platform_device *pdev)
 	u32 chn_count;
 	int ret, i;
 
-	ret = device_property_read_u32(&pdev->dev, "#dma-channels", &chn_count);
+	/* Parse new and deprecated dma-channels properties */
+	ret = device_property_read_u32(&pdev->dev, "dma-channels", &chn_count);
+	if (ret)
+		ret = device_property_read_u32(&pdev->dev, "#dma-channels",
+					       &chn_count);
 	if (ret) {
 		dev_err(&pdev->dev, "get dma channels count failed\n");
 		return ret;