From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>, Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org,
spear-devel <spear-devel@list.st.com>,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v2.1] dw_dmac: make wrapper on of_dma_controller_register()
Date: Tue, 26 Mar 2013 19:12:02 +0200 [thread overview]
Message-ID: <1364317922.6652.34.camel@smile> (raw)
In-Reply-To: <CAKohpoksxVo3fFdaqOBucOzJs_aU3XGiTcM3b6GzW=m=ooFzQQ@mail.gmail.com>
On Tue, 2013-03-26 at 22:37 +0530, Viresh Kumar wrote:
> On 26 March 2013 22:34, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > This patch introduces new method dw_dma_of_controller_register(). The wrapper
> > is called only when of_node is present.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > drivers/dma/dw_dmac.c | 19 ++++++++++++-------
> > 1 file changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> > index 274fd7d..12657d7 100644
> > --- a/drivers/dma/dw_dmac.c
> > +++ b/drivers/dma/dw_dmac.c
> > @@ -1303,6 +1303,16 @@ static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec,
> > return dma_request_channel(cap, dw_dma_of_filter, &fargs);
> > }
> >
> > +static void dw_dma_of_controller_register(struct dw_dma *dw)
> > +{
> > + struct device *dev = dw->dma.dev;
> > + int err;
> > +
> > + err = of_dma_controller_register(dev->of_node, dw_dma_of_xlate, dw);
> > + if (err)
> > + dev_err(dev, "could not register of_dma_controller\n");
> > +}
> > +
> > /* --------------------- Cyclic DMA API extensions -------------------- */
> >
> > /**
> > @@ -1843,13 +1853,8 @@ static int dw_probe(struct platform_device *pdev)
> >
> > dma_async_device_register(&dw->dma);
> >
> > - if (pdev->dev.of_node) {
> > - err = of_dma_controller_register(pdev->dev.of_node,
> > - dw_dma_of_xlate, dw);
> > - if (err && err != -ENODEV)
> > - dev_err(&pdev->dev,
> > - "could not register of_dma_controller\n");
> > - }
> > + if (pdev->dev.of_node)
> > + dw_dma_of_controller_register(dw);
>
> I forgot where we started from, but what's the need of this patch?
Nowadays, besides removal of the -ENODEV checking, it makes probe
function looks tidier.
Think about upcoming stuff (e.g. ACPI), if we put everything inside
probe it will look overloaded.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2013-03-26 17:12 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 14:53 [PATCH v2 0/4] dw_dmac: cleanup for DT usage Andy Shevchenko
2013-03-26 14:53 ` [PATCH v2 1/4] dw_dmac: fix style of the comments Andy Shevchenko
2013-03-26 15:01 ` Arnd Bergmann
2013-03-26 14:53 ` [PATCH v2 2/4] dw_dmac: rename DT related methods to reflect their belonging Andy Shevchenko
2013-03-26 15:02 ` Arnd Bergmann
2013-03-26 14:53 ` [PATCH v2 3/4] dw_dmac: make wrapper on of_dma_controller_register() Andy Shevchenko
2013-03-26 15:01 ` Arnd Bergmann
2013-03-26 15:04 ` Lars-Peter Clausen
2013-03-26 16:59 ` Andy Shevchenko
2013-03-26 17:04 ` [PATCH v2.1] " Andy Shevchenko
2013-03-26 17:07 ` Viresh Kumar
2013-03-26 17:12 ` Andy Shevchenko [this message]
2013-03-26 17:16 ` Viresh Kumar
2013-03-26 17:29 ` [PATCH v2.2] dw_dmac: remove unnecessary ENODEV check Andy Shevchenko
2013-03-26 17:31 ` Viresh Kumar
2013-03-26 18:15 ` Arnd Bergmann
2013-03-26 14:53 ` [PATCH v2 4/4] dmaengine: dw_dmac: simplify master selection Andy Shevchenko
2013-03-26 14:53 ` Andy Shevchenko
2013-03-26 15:02 ` Arnd Bergmann
2013-03-26 15:02 ` Arnd Bergmann
2013-04-01 17:55 ` [PATCH v2 0/4] dw_dmac: cleanup for DT usage Vinod Koul
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=1364317922.6652.34.camel@smile \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=lars@metafoo.de \
--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: 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.