From: Huang Shijie <sjhuang@iluvatar.ai>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: vkoul@kernel.org, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org, dave.jiang@intel.com,
radhey.shyam.pandey@xilinx.com, appana.durga.rao@xilinx.com,
jmkrzyszt@gmail.com, gomonovych@gmail.com, keescook@chromium.org,
horms+renesas@verge.net.au, geert+renesas@glider.be,
shawnguo@kernel.org, baoyou.xie@linaro.org,
michal.simek@xilinx.com, baohua@kernel.org,
ludovic.desroches@microchip.com, linus.walleij@linaro.org,
david.brown@linaro.org
Subject: [07/46] dmaengine: omap-dma: use dmaenginem_async_device_register to simplify the code
Date: Fri, 3 Aug 2018 15:52:51 +0800 [thread overview]
Message-ID: <20180803075250.GA29473@hsj-Precision-5520> (raw)
On Fri, Aug 03, 2018 at 10:47:30AM +0300, Peter Ujfalusi wrote:
>
>
> On 2018-08-03 10:19, Huang Shijie wrote:
> > Use dmaenginem_async_device_register to simplify the code:
> > remove dma_async_device_unregister
> >
> > Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
> > ---
> > drivers/dma/ti/omap-dma.c | 5 +----
> > 1 file changed, 1 insertion(+), 4 deletions(-)
> >
> > diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c
> > index a4a931ddf6f6..085748c6eb67 100644
> > --- a/drivers/dma/ti/omap-dma.c
> > +++ b/drivers/dma/ti/omap-dma.c
> > @@ -1566,7 +1566,7 @@ static int omap_dma_probe(struct platform_device *pdev)
> > }
> > }
> >
> > - rc = dma_async_device_register(&od->ddev);
> > + rc = dmaenginem_async_device_register(&od->ddev);
>
> Why it is dmaenginem_async_device_register() and not aligned other
> resource managed functions (devm_* dmam_*), like
> devm_dma_async_device_register()
Vinod prefer the this dmaenginem_async_device_register..
>
> and in dmaenginem_async_device_register() what is the 'm' in dmaenginem ?
> DMAengine Managed?
Yes.
>
> > if (rc) {
> > pr_warn("OMAP-DMA: failed to register slave DMA engine device: %d\n",
> > rc);
> > @@ -1584,7 +1584,6 @@ static int omap_dma_probe(struct platform_device *pdev)
> > of_dma_simple_xlate, &omap_dma_info);
> > if (rc) {
> > pr_warn("OMAP-DMA: failed to register DMA controller\n");
> > - dma_async_device_unregister(&od->ddev);
> > omap_dma_free(od);
> > }
> > }
> > @@ -1606,8 +1605,6 @@ static int omap_dma_remove(struct platform_device *pdev)
> > irq = platform_get_irq(pdev, 1);
> > devm_free_irq(&pdev->dev, irq, od);
> >
> > - dma_async_device_unregister(&od->ddev);
> > -
>
> I think this is a bad idea in general.
> We need to unregister the dma-device before we clean up and free resources.
okay, thanks for pointing here.
We can drop this patch now...
>
> > if (!od->legacy) {
> > /* Disable all interrupts */
> > omap_dma_glbl_write(od, IRQENABLE_L0, 0);
> >
>
> I'm sorry to say, but it is a NACK from me.
No problem.
Thanks
Huang Shijie
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2018-08-03 7:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-03 7:52 Huang Shijie [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-09 2:36 [07/46] dmaengine: omap-dma: use dmaenginem_async_device_register to simplify the code Vinod Koul
2018-08-03 7:47 Peter Ujfalusi
2018-08-03 7:19 Huang Shijie
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=20180803075250.GA29473@hsj-Precision-5520 \
--to=sjhuang@iluvatar.ai \
--cc=appana.durga.rao@xilinx.com \
--cc=baohua@kernel.org \
--cc=baoyou.xie@linaro.org \
--cc=dave.jiang@intel.com \
--cc=david.brown@linaro.org \
--cc=dmaengine@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=gomonovych@gmail.com \
--cc=horms+renesas@verge.net.au \
--cc=jmkrzyszt@gmail.com \
--cc=keescook@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=michal.simek@xilinx.com \
--cc=peter.ujfalusi@ti.com \
--cc=radhey.shyam.pandey@xilinx.com \
--cc=shawnguo@kernel.org \
--cc=vkoul@kernel.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