All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Olivier Dautricourt <olivier.dautricourt@orolia.com>
Cc: Rob Herring <robh+dt@kernel.org>, Stefan Roese <sr@denx.de>,
	dmaengine@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/3] dmaengine: altera-msgdma: add OF support
Date: Mon, 7 Jun 2021 12:29:09 +0530	[thread overview]
Message-ID: <YL3DvQWhn+SsBqhJ@vkoul-mobl> (raw)
In-Reply-To: <088a373c92bdee6e24da771c1ae2e4ed0887c0d7.1621343877.git.olivier.dautricourt@orolia.com>

On 18-05-21, 15:25, Olivier Dautricourt wrote:
> This driver had no device tree support.
> 
> - add compatible field "altr,socfpga-msgdma"
> - define msgdma_of_xlate, with no argument
> - register dma controller with of_dma_controller_register
> 
> Reviewed-by: Stefan Roese <sr@denx.de>
> Signed-off-by: Olivier Dautricourt <olivier.dautricourt@orolia.com>
> ---
> 
> Notes:
>     Changes in v2:
>         none
> 
>     Changes from v2 to v3:
>         Removed CONFIG_OF #ifdef's and use if (IS_ENABLED(CONFIG_OF))
>         only once.
> 
>     Changes from v3 to v4
>         Reintroduce #ifdef CONFIG_OF for msgdma_match
>         as it produces a unused variable warning
> 
>     Changes from v4 to v5
>         - As per Rob's comments on patch 1/2:
>           change compatible field from altr,msgdma to
>           altr,socfpga-msgdma.
>         - change commit title to fit previous commits naming
>         - As per Vinod's comments:
>           - use dma_get_slave_channel instead of dma_get_any_slave_channel which
>             makes more sense.
>           - remove if (IS_ENABLED(CONFIG_OF)) for of_dma_controller_register
>             as it is taken care by the core
> 
>  drivers/dma/altera-msgdma.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/dma/altera-msgdma.c b/drivers/dma/altera-msgdma.c
> index 9a841ce5f0c5..acf0990d73ae 100644
> --- a/drivers/dma/altera-msgdma.c
> +++ b/drivers/dma/altera-msgdma.c
> @@ -19,6 +19,7 @@
>  #include <linux/module.h>
>  #include <linux/platform_device.h>
>  #include <linux/slab.h>
> +#include <linux/of_dma.h>
> 
>  #include "dmaengine.h"
> 
> @@ -784,6 +785,14 @@ static int request_and_map(struct platform_device *pdev, const char *name,
>  	return 0;
>  }
> 
> +static struct dma_chan *msgdma_of_xlate(struct of_phandle_args *dma_spec,
> +					struct of_dma *ofdma)
> +{
> +	struct msgdma_device *d = ofdma->of_dma_data;
> +
> +	return dma_get_slave_channel(&d->dmachan);
> +}

Why not use of_dma_simple_xlate() instead?

> +
>  /**
>   * msgdma_probe - Driver probe function
>   * @pdev: Pointer to the platform_device structure
> @@ -888,6 +897,13 @@ static int msgdma_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto fail;
> 
> +	ret = of_dma_controller_register(pdev->dev.of_node,
> +					 msgdma_of_xlate, mdev);
> +	if (ret) {
> +		dev_err(&pdev->dev, "failed to register dma controller");
> +		goto fail;

Should this be treated as an error.. the probe will be invoked on non of
systems too..

-- 
~Vinod

  reply	other threads:[~2021-06-07  6:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 13:23 [PATCH v5 1/3] dt-bindings: dma: add schema for altera-msgdma Olivier Dautricourt
2021-05-18 13:24 ` [PATCH v5 2/3] MAINTAINERS: add entry for Altera mSGDMA Olivier Dautricourt
2021-05-18 13:25 ` [PATCH v5 3/3] dmaengine: altera-msgdma: add OF support Olivier Dautricourt
2021-06-07  6:59   ` Vinod Koul [this message]
2021-06-07  8:28     ` Olivier Dautricourt
2021-06-07 10:08       ` Vinod Koul
2021-06-07 10:45         ` Olivier Dautricourt
2021-06-07 10:50           ` Stefan Roese
2021-05-19 22:11 ` [PATCH v5 1/3] dt-bindings: dma: add schema for altera-msgdma Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YL3DvQWhn+SsBqhJ@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olivier.dautricourt@orolia.com \
    --cc=robh+dt@kernel.org \
    --cc=sr@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.