From: Huang Shijie <sjhuang@iluvatar.ai>
To: vkoul@kernel.org
Cc: dan.j.williams@intel.com, Zubair.Kakakhel@imgtec.com,
daniel@zonque.org, haojian.zhuang@gmail.com,
robert.jarzmik@free.fr, patrice.chotard@st.com,
linus.walleij@linaro.org, mcoquelin.stm32@gmail.com,
alexandre.torgue@st.com, Eugeniy.Paltsev@synopsys.com,
colin.king@canonical.com, dmaengine@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Huang Shijie <sjhuang@iluvatar.ai>
Subject: [v2,5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code
Date: Mon, 6 Aug 2018 16:52:27 +0800 [thread overview]
Message-ID: <20180806085231.4597-6-sjhuang@iluvatar.ai> (raw)
Use dmaenginem_async_device_register to simplify the code:
remove dma_async_device_unregister.
remove label unregister_slave, unregister_memcpy
Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
drivers/dma/ste_dma40.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index f4edfc56f34e..5e328bd10c27 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2839,7 +2839,7 @@ static int __init d40_dmaengine_init(struct d40_base *base,
d40_ops_init(base, &base->dma_slave);
- err = dma_async_device_register(&base->dma_slave);
+ err = dmaenginem_async_device_register(&base->dma_slave);
if (err) {
d40_err(base->dev, "Failed to register slave channels\n");
@@ -2854,12 +2854,12 @@ static int __init d40_dmaengine_init(struct d40_base *base,
d40_ops_init(base, &base->dma_memcpy);
- err = dma_async_device_register(&base->dma_memcpy);
+ err = dmaenginem_async_device_register(&base->dma_memcpy);
if (err) {
d40_err(base->dev,
"Failed to register memcpy only channels\n");
- goto unregister_slave;
+ goto exit;
}
d40_chan_init(base, &base->dma_both, base->phy_chans,
@@ -2871,18 +2871,14 @@ static int __init d40_dmaengine_init(struct d40_base *base,
dma_cap_set(DMA_CYCLIC, base->dma_slave.cap_mask);
d40_ops_init(base, &base->dma_both);
- err = dma_async_device_register(&base->dma_both);
+ err = dmaenginem_async_device_register(&base->dma_both);
if (err) {
d40_err(base->dev,
"Failed to register logical and physical capable channels\n");
- goto unregister_memcpy;
+ goto exit;
}
return 0;
- unregister_memcpy:
- dma_async_device_unregister(&base->dma_memcpy);
- unregister_slave:
- dma_async_device_unregister(&base->dma_slave);
exit:
return err;
}
next reply other threads:[~2018-08-06 8:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-06 8:52 Huang Shijie [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-06 10:34 [v2,5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code Linus Walleij
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=20180806085231.4597-6-sjhuang@iluvatar.ai \
--to=sjhuang@iluvatar.ai \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=Zubair.Kakakhel@imgtec.com \
--cc=alexandre.torgue@st.com \
--cc=colin.king@canonical.com \
--cc=dan.j.williams@intel.com \
--cc=daniel@zonque.org \
--cc=dmaengine@vger.kernel.org \
--cc=haojian.zhuang@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=patrice.chotard@st.com \
--cc=robert.jarzmik@free.fr \
--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