From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Viresh Kumar <viresh.kumar@linaro.org> Cc: vinod.koul@intel.com, linux-kernel@vger.kernel.org, spear-devel@list.st.com, linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org Subject: Re: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Date: Fri, 12 Oct 2012 17:58:17 +0300 [thread overview] Message-ID: <1350053897.10584.172.camel@smile> (raw) In-Reply-To: <9688d98010716880c1bbd966ead312c446282204.1350051925.git.viresh.kumar@linaro.org> On Fri, 2012-10-12 at 20:01 +0530, Viresh Kumar wrote: > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > @@ -1179,6 +1179,53 @@ static void dwc_free_chan_resources(struct dma_chan *chan) > dev_vdbg(chan2dev(chan), "%s: done\n", __func__); > } > > +bool dw_dma_generic_filter(struct dma_chan *chan, void *param) > +{ > + struct dw_dma *dw = to_dw_dma(chan->device); > + static struct dw_dma *last_dw; > + static char *last_bus_id; > + int i = -1; > + > + /* > + * dmaengine framework calls this routine for all channels of all dma > + * controller, until true is returned. If 'param' bus_id is not > + * registered with a dma controller (dw), then there is no need of > + * running below function for all channels of dw. > + * > + * This block of code does this by saving the parameters of last > + * failure. If dw and param are same, i.e. trying on same dw with > + * different channel, return false. > + */ > + if (last_dw) { > + if ((last_bus_id == param) && (last_dw == dw)) > + return false; > + } Just came to my mind. dw can't be NULL, can't it? Then if (last_dw) { ... } is unneeded. Please, check twice my thought because it's a Friday evening. > @@ -1462,6 +1509,91 @@ static void dw_dma_off(struct dw_dma *dw) > dw->chan[i].initialized = false; > } > > +#ifdef CONFIG_OF > +static struct dw_dma_platform_data * > +__devinit dw_dma_parse_dt(struct platform_device *pdev) > +{ > + struct device_node *sn, *cn, *np = pdev->dev.of_node; > + struct dw_dma_platform_data *pdata; > + struct dw_dma_slave *sd; > + u32 val, arr[4]; Let me weekend to think about naming. I really can't offer anything else right now. -- Andy Shevchenko <andriy.shevchenko@linux.intel.com> Intel Finland Oy
WARNING: multiple messages have this Message-ID (diff)
From: andriy.shevchenko@linux.intel.com (Andy Shevchenko) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Date: Fri, 12 Oct 2012 17:58:17 +0300 [thread overview] Message-ID: <1350053897.10584.172.camel@smile> (raw) In-Reply-To: <9688d98010716880c1bbd966ead312c446282204.1350051925.git.viresh.kumar@linaro.org> On Fri, 2012-10-12 at 20:01 +0530, Viresh Kumar wrote: > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c > @@ -1179,6 +1179,53 @@ static void dwc_free_chan_resources(struct dma_chan *chan) > dev_vdbg(chan2dev(chan), "%s: done\n", __func__); > } > > +bool dw_dma_generic_filter(struct dma_chan *chan, void *param) > +{ > + struct dw_dma *dw = to_dw_dma(chan->device); > + static struct dw_dma *last_dw; > + static char *last_bus_id; > + int i = -1; > + > + /* > + * dmaengine framework calls this routine for all channels of all dma > + * controller, until true is returned. If 'param' bus_id is not > + * registered with a dma controller (dw), then there is no need of > + * running below function for all channels of dw. > + * > + * This block of code does this by saving the parameters of last > + * failure. If dw and param are same, i.e. trying on same dw with > + * different channel, return false. > + */ > + if (last_dw) { > + if ((last_bus_id == param) && (last_dw == dw)) > + return false; > + } Just came to my mind. dw can't be NULL, can't it? Then if (last_dw) { ... } is unneeded. Please, check twice my thought because it's a Friday evening. > @@ -1462,6 +1509,91 @@ static void dw_dma_off(struct dw_dma *dw) > dw->chan[i].initialized = false; > } > > +#ifdef CONFIG_OF > +static struct dw_dma_platform_data * > +__devinit dw_dma_parse_dt(struct platform_device *pdev) > +{ > + struct device_node *sn, *cn, *np = pdev->dev.of_node; > + struct dw_dma_platform_data *pdata; > + struct dw_dma_slave *sd; > + u32 val, arr[4]; Let me weekend to think about naming. I really can't offer anything else right now. -- Andy Shevchenko <andriy.shevchenko@linux.intel.com> Intel Finland Oy
next prev parent reply other threads:[~2012-10-12 14:58 UTC|newest] Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-12 14:31 [PATCH V2 1/3] dmaengine: dw_dmac: Update documentation style comments for dw_dma_platform_data Viresh Kumar 2012-10-12 14:31 ` Viresh Kumar 2012-10-12 14:31 ` [PATCH V2 2/3] dmaengine: dw_dmac: Enhance device tree support Viresh Kumar 2012-10-12 14:31 ` Viresh Kumar 2012-10-12 14:50 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 14:50 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 14:55 ` Viresh Kumar 2012-10-12 14:55 ` Viresh Kumar 2012-10-12 16:20 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 16:20 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 17:14 ` Viresh Kumar 2012-10-12 17:14 ` Viresh Kumar 2012-10-12 14:58 ` Andy Shevchenko [this message] 2012-10-12 14:58 ` Andy Shevchenko 2012-10-12 15:18 ` Viresh Kumar 2012-10-12 15:18 ` Viresh Kumar 2012-10-12 15:53 ` Andy Shevchenko 2012-10-12 15:53 ` Andy Shevchenko 2012-10-12 15:55 ` Viresh Kumar 2012-10-12 15:55 ` Viresh Kumar 2012-10-15 3:29 ` Viresh Kumar 2012-10-15 3:29 ` Viresh Kumar 2012-10-15 7:35 ` Andy Shevchenko 2012-10-15 7:35 ` Andy Shevchenko 2012-10-12 14:31 ` [PATCH V2 3/3] ARM: SPEAr13xx: Pass DW DMAC platform data from DT Viresh Kumar 2012-10-12 14:31 ` Viresh Kumar 2012-10-12 14:48 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 14:48 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 14:48 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 14:52 ` Viresh Kumar 2012-10-12 14:52 ` Viresh Kumar 2012-10-12 16:21 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 16:21 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-12 17:12 ` Viresh Kumar 2012-10-12 17:12 ` Viresh Kumar 2012-10-13 6:44 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-13 6:44 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-13 8:48 ` Viresh Kumar 2012-10-13 8:48 ` Viresh Kumar 2012-10-13 12:22 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-13 12:22 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-13 12:22 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-13 14:08 ` Viresh Kumar 2012-10-13 14:08 ` Viresh Kumar 2012-10-13 14:10 ` Viresh Kumar 2012-10-13 14:10 ` Viresh Kumar 2012-10-14 10:01 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-14 10:01 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-14 10:01 ` Jean-Christophe PLAGNIOL-VILLARD 2012-10-15 3:21 ` Viresh Kumar 2012-10-15 3:21 ` Viresh Kumar
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=1350053897.10584.172.camel@smile \ --to=andriy.shevchenko@linux.intel.com \ --cc=devicetree-discuss@lists.ozlabs.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=spear-devel@list.st.com \ --cc=vinod.koul@intel.com \ --cc=viresh.kumar@linaro.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: linkBe 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.