From: Ben Dooks <ben.dooks@codethink.co.uk>
To: "Shevchenko, Andriy" <andriy.shevchenko@intel.com>
Cc: "linux-kernel@lists.codethink.co.uk"
<linux-kernel@lists.codethink.co.uk>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
"Koul, Vinod" <vinod.koul@intel.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
"magnus.damm@opensource.se" <magnus.damm@opensource.se>,
"horms@verge.net.au" <horms@verge.net.au>,
"g.liakhovetski@gmx.d" <g.liakhovetski@gmx.d>,
"kuninori.morimoto.gx@renesas.com"
<kuninori.morimoto.gx@renesas.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH 8/9] DMA: shdma: initial of common code
Date: Tue, 08 Apr 2014 08:53:13 +0000 [thread overview]
Message-ID: <5343B8F9.2050800@codethink.co.uk> (raw)
In-Reply-To: <1396944263.11914.80.camel@smile.fi.intel.com>
On 08/04/14 09:04, Shevchenko, Andriy wrote:
> On Mon, 2014-04-07 at 21:07 +0100, Ben Dooks wrote:
>> Add support for building shdma internal data from the device tree to allow
>> converting the driver to be device tree enabled.
>>
>> It includes a helper for the of case to build the internal data used to
>> select and filter out the DMA channels from the ID information in the
>> device tree. Also updates the documentation for the DT case.
>
>
> Few minor comments below.
>
>> --- a/drivers/dma/sh/shdma-of.c
>> +++ b/drivers/dma/sh/shdma-of.c
>
>
>> @@ -40,6 +71,109 @@ static struct dma_chan *shdma_of_xlate(struct of_phandle_args *dma_spec,
>> return chan;
>> }
>>
>> +const struct sh_dmae_pdata *
>> +sh_dma_probe_of(struct platform_device *pdev, const struct of_device_id *ofmatch)
>> +{
>> + const struct device_node *np = pdev->dev.of_node;
>> + const struct sh_dmae_of_info *ofinf;
>> + struct device *dev = &pdev->dev;
>> + struct sh_dmae_pdata *pdata;
>> + struct sh_dmae_channel *chan;
>> + struct property *prop;
>> + u32 nr_chan;
>> + unsigned ch;
>> + int ret;
>> + int len;
>> +
>> + if (!ofmatch)
>> + return NULL;
>> +
>> + ofinf = ofmatch->data;
>> +
>> + pdata = devm_kzalloc(dev, sizeof(struct sh_dmae_pdata), GFP_KERNEL);
>
> sizeof(*pdata) ?
I will think on this one.
>> + if (!pdata) {
>> + dev_err(dev, "failed to make platform data\n");
>> + return NULL;
>> + }
>> +
>> + *pdata = *ofinf->pdata_template; /* copy in template first */
>> +
>> + ret = of_property_read_u32(np, "dma-channels", &nr_chan);
>> + if (ret < 0) {
>> + dev_err(dev, "failed to get number of channels\n");
>> + return NULL;
>> + }
>> +
>> + chan = devm_kzalloc(dev, nr_chan * sizeof(struct sh_dmae_channel),
>> + GFP_KERNEL);
>
> devm_kcalloc()
Thanks.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
WARNING: multiple messages have this Message-ID (diff)
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: "Shevchenko, Andriy" <andriy.shevchenko@intel.com>
Cc: "linux-kernel@lists.codethink.co.uk"
<linux-kernel@lists.codethink.co.uk>,
"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
"Koul, Vinod" <vinod.koul@intel.com>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"linux-sh@vger.kernel.org" <linux-sh@vger.kernel.org>,
"magnus.damm@opensource.se" <magnus.damm@opensource.se>,
"horms@verge.net.au" <horms@verge.net.au>,
"g.liakhovetski@gmx.d" <g.liakhovetski@gmx.d>,
"kuninori.morimoto.gx@renesas.com"
<kuninori.morimoto.gx@renesas.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH 8/9] DMA: shdma: initial of common code
Date: Tue, 08 Apr 2014 09:53:13 +0100 [thread overview]
Message-ID: <5343B8F9.2050800@codethink.co.uk> (raw)
In-Reply-To: <1396944263.11914.80.camel@smile.fi.intel.com>
On 08/04/14 09:04, Shevchenko, Andriy wrote:
> On Mon, 2014-04-07 at 21:07 +0100, Ben Dooks wrote:
>> Add support for building shdma internal data from the device tree to allow
>> converting the driver to be device tree enabled.
>>
>> It includes a helper for the of case to build the internal data used to
>> select and filter out the DMA channels from the ID information in the
>> device tree. Also updates the documentation for the DT case.
>
>
> Few minor comments below.
>
>> --- a/drivers/dma/sh/shdma-of.c
>> +++ b/drivers/dma/sh/shdma-of.c
>
>
>> @@ -40,6 +71,109 @@ static struct dma_chan *shdma_of_xlate(struct of_phandle_args *dma_spec,
>> return chan;
>> }
>>
>> +const struct sh_dmae_pdata *
>> +sh_dma_probe_of(struct platform_device *pdev, const struct of_device_id *ofmatch)
>> +{
>> + const struct device_node *np = pdev->dev.of_node;
>> + const struct sh_dmae_of_info *ofinf;
>> + struct device *dev = &pdev->dev;
>> + struct sh_dmae_pdata *pdata;
>> + struct sh_dmae_channel *chan;
>> + struct property *prop;
>> + u32 nr_chan;
>> + unsigned ch;
>> + int ret;
>> + int len;
>> +
>> + if (!ofmatch)
>> + return NULL;
>> +
>> + ofinf = ofmatch->data;
>> +
>> + pdata = devm_kzalloc(dev, sizeof(struct sh_dmae_pdata), GFP_KERNEL);
>
> sizeof(*pdata) ?
I will think on this one.
>> + if (!pdata) {
>> + dev_err(dev, "failed to make platform data\n");
>> + return NULL;
>> + }
>> +
>> + *pdata = *ofinf->pdata_template; /* copy in template first */
>> +
>> + ret = of_property_read_u32(np, "dma-channels", &nr_chan);
>> + if (ret < 0) {
>> + dev_err(dev, "failed to get number of channels\n");
>> + return NULL;
>> + }
>> +
>> + chan = devm_kzalloc(dev, nr_chan * sizeof(struct sh_dmae_channel),
>> + GFP_KERNEL);
>
> devm_kcalloc()
Thanks.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
next prev parent reply other threads:[~2014-04-08 8:53 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-07 20:07 shdma of updates and r8a7790 enablement Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 20:07 ` [PATCH 1/9] ARM: shmobile: r8a7790: add dmac0,dmac1 clocks Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 20:07 ` [PATCH 2/9] ARM: shmobile: r8a7790: add dma defines for sys and audio dmacs Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-08 10:48 ` [Linux-kernel] " Ben Hutchings
2014-04-08 10:48 ` Ben Hutchings
2014-04-08 10:49 ` Ben Dooks
2014-04-08 10:49 ` Ben Dooks
2014-04-08 13:22 ` Laurent Pinchart
2014-04-08 13:22 ` Laurent Pinchart
2014-04-08 13:55 ` Ben Dooks
2014-04-08 13:55 ` Ben Dooks
2014-04-08 14:24 ` Laurent Pinchart
2014-04-08 14:24 ` Laurent Pinchart
2014-04-07 20:07 ` [PATCH 3/9] ARM: shmobile: r8a7790: add dmac0 dmac1 nodes Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 21:05 ` Geert Uytterhoeven
2014-04-07 21:05 ` Geert Uytterhoeven
2014-04-08 13:58 ` Ben Dooks
2014-04-08 13:58 ` Ben Dooks
2014-04-07 20:07 ` [PATCH 4/9] ARM: shmobile: r8a7790: Add DMA for MMCIF1 Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 20:07 ` [PATCH 5/9] ARM: shmobile: add Audio DMAC clocks Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 20:07 ` [PATCH 6/9] ARM: shmobile: r8a7790: add audio dmac node Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 20:39 ` Sergei Shtylyov
2014-04-07 20:39 ` Sergei Shtylyov
2014-04-08 13:58 ` Ben Dooks
2014-04-08 13:58 ` Ben Dooks
2014-04-07 20:07 ` [PATCH 7/9] ARM: shmobile: lager: enable sysdma units 0 and 1 Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 20:07 ` [PATCH 8/9] DMA: shdma: initial of common code Ben Dooks
2014-04-07 20:07 ` Ben Dooks
2014-04-07 20:55 ` Sergei Shtylyov
2014-04-07 20:55 ` Sergei Shtylyov
2014-04-08 8:04 ` Shevchenko, Andriy
2014-04-08 8:04 ` Shevchenko, Andriy
2014-04-08 8:53 ` Ben Dooks [this message]
2014-04-08 8:53 ` Ben Dooks
2014-04-08 13:30 ` Laurent Pinchart
2014-04-08 13:30 ` Laurent Pinchart
2014-04-07 20:07 ` [PATCH 9/9] DMA: shdma: wire r8a7790 Ben Dooks
2014-04-07 20:07 ` Ben Dooks
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=5343B8F9.2050800@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=andriy.shevchenko@intel.com \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=g.liakhovetski@gmx.d \
--cc=horms@verge.net.au \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-kernel@lists.codethink.co.uk \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@opensource.se \
--cc=vinod.koul@intel.com \
/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.