devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	djbw-b10kYP2dOMg@public.gmane.org,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v3 1/2] dma: imx-dma: Add oftree support
Date: Mon, 25 Feb 2013 16:24:51 +0000	[thread overview]
Message-ID: <201302251624.52014.arnd@arndb.de> (raw)
In-Reply-To: <1361808255-17381-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

On Monday 25 February 2013, Markus Pargmann wrote:
> Adding devicetree support for imx-dma driver. Use driver name for
> function 'imx_dma_is_general_purpose' because the devicename for
> devicetree initialized devices is different.
> 
> Changes in V3:
> - Create a imxdma translate function to pass the device object into the
>   filter function.
> 
> Changes in V2:
> - Change the driver to use generic DMA DT bindings.
> - Add a imx-dma filter function that sets the dma request line in
>   private data.
> 
> Signed-off-by: Markus Pargmann <mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

Looks correct now,

Reviewed-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>

I have one idea for an optimization though:

> +static bool imxdma_filter_fn(struct dma_chan *chan, void *param)
> +{
> +	struct imxdma_filter_data *fdata = param;
> +	struct imx_dma_data *data;
> +
> +	if (chan->device->dev != fdata->imxdma->dev)
> +		return false;
> +
> +	data = kzalloc(sizeof(*data), GFP_KERNEL);
> +
> +	if (!data)
> +		return false;
> +
> +	data->dma_request = fdata->request;
> +	data->alloc_ctl_filter = true;
> +	chan->private = data;
> +
> +	return true;
> +}

There is already a "dma_request" member in "struct imxdma_channel", so
you could use that instead of allocating the imx_dma_data here.

Then you don't need to keep track of freeing that memory again, but
you might have to change a few other functions that look at data->dma_request
rather than chan->dma_request at the moment and change them to
use the latter instead. You can copy data->dma_request over in the
alloc_chan_resources functions for the legacy case.

	Arnd

  parent reply	other threads:[~2013-02-25 16:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 14:37 [PATCH] dma: imx-dma: Add oftree support Markus Pargmann
     [not found] ` <1361543838-12604-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-22 14:46   ` Arnd Bergmann
     [not found]     ` <201302221446.07069.arnd-r2nGTMty4D4@public.gmane.org>
2013-02-23 16:57       ` Markus Pargmann
2013-02-23 16:59   ` [PATCH V2] " Markus Pargmann
     [not found]     ` <1361638770-29235-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-23 22:16       ` Arnd Bergmann
     [not found]         ` <201302232216.22113.arnd-r2nGTMty4D4@public.gmane.org>
2013-02-24 12:27           ` Markus Pargmann
     [not found]             ` <20130224122748.GF10660-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-25 14:31               ` Arnd Bergmann
2013-02-25 16:04   ` [PATCH v3 1/2] " Markus Pargmann
     [not found]     ` <1361808255-17381-1-git-send-email-mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-25 16:04       ` [PATCH v3 2/2] DMA: imx-dma: imxdma->dev used uninitialized Markus Pargmann
2013-02-25 16:24       ` Arnd Bergmann [this message]
     [not found]         ` <201302251624.52014.arnd-r2nGTMty4D4@public.gmane.org>
2013-02-25 16:53           ` [PATCH v3 1/2] dma: imx-dma: Add oftree support Markus Pargmann
2013-02-28  6:30       ` Shawn Guo
     [not found]         ` <20130228063026.GC26106-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2013-03-01 13:56           ` Markus Pargmann

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=201302251624.52014.arnd@arndb.de \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=djbw-b10kYP2dOMg@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=mpa-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).