From: Daniel Mack <zonque@gmail.com>
To: linux-usb@vger.kernel.org
Cc: linux-omap@vger.kernel.org, neumann@teufel.de,
bigeasy@linutronix.de, sergei.shtylyov@cogentembedded.com,
vinod.koul@intel.com, dan.j.williams@intel.com, balbi@ti.com,
gregkh@linuxfoundation.org, Daniel Mack <zonque@gmail.com>
Subject: [PATCH v3 3/5] dma: cppi41: add shortcut to &pdev->dev in cppi41_dma_probe()
Date: Sun, 22 Sep 2013 16:50:02 +0200 [thread overview]
Message-ID: <1379861404-8250-4-git-send-email-zonque@gmail.com> (raw)
In-Reply-To: <1379861404-8250-1-git-send-email-zonque@gmail.com>
Makes the code more readable and compact. No functional change.
Signed-off-by: Daniel Mack <zonque@gmail.com>
---
drivers/dma/cppi41.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index 5469a15..d689706 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -927,11 +927,12 @@ static const struct cppi_glue_infos *get_glue_info(struct device *dev)
static int cppi41_dma_probe(struct platform_device *pdev)
{
struct cppi41_dd *cdd;
+ struct device *dev = &pdev->dev;
const struct cppi_glue_infos *glue_info;
int irq;
int ret;
- glue_info = get_glue_info(&pdev->dev);
+ glue_info = get_glue_info(dev);
if (!glue_info)
return -EINVAL;
@@ -946,14 +947,14 @@ static int cppi41_dma_probe(struct platform_device *pdev)
cdd->ddev.device_issue_pending = cppi41_dma_issue_pending;
cdd->ddev.device_prep_slave_sg = cppi41_dma_prep_slave_sg;
cdd->ddev.device_control = cppi41_dma_control;
- cdd->ddev.dev = &pdev->dev;
+ cdd->ddev.dev = dev;
INIT_LIST_HEAD(&cdd->ddev.channels);
cpp41_dma_info.dma_cap = cdd->ddev.cap_mask;
- cdd->usbss_mem = of_iomap(pdev->dev.of_node, 0);
- cdd->ctrl_mem = of_iomap(pdev->dev.of_node, 1);
- cdd->sched_mem = of_iomap(pdev->dev.of_node, 2);
- cdd->qmgr_mem = of_iomap(pdev->dev.of_node, 3);
+ cdd->usbss_mem = of_iomap(dev->of_node, 0);
+ cdd->ctrl_mem = of_iomap(dev->of_node, 1);
+ cdd->sched_mem = of_iomap(dev->of_node, 2);
+ cdd->qmgr_mem = of_iomap(dev->of_node, 3);
if (!cdd->usbss_mem || !cdd->ctrl_mem || !cdd->sched_mem ||
!cdd->qmgr_mem) {
@@ -961,8 +962,8 @@ static int cppi41_dma_probe(struct platform_device *pdev)
goto err_remap;
}
- pm_runtime_enable(&pdev->dev);
- ret = pm_runtime_get_sync(&pdev->dev);
+ pm_runtime_enable(dev);
+ ret = pm_runtime_get_sync(dev);
if (ret)
goto err_get_sync;
@@ -970,22 +971,22 @@ static int cppi41_dma_probe(struct platform_device *pdev)
cdd->queues_tx = glue_info->queues_tx;
cdd->td_queue = glue_info->td_queue;
- ret = init_cppi41(&pdev->dev, cdd);
+ ret = init_cppi41(dev, cdd);
if (ret)
goto err_init_cppi;
- ret = cppi41_add_chans(&pdev->dev, cdd);
+ ret = cppi41_add_chans(dev, cdd);
if (ret)
goto err_chans;
- irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
+ irq = irq_of_parse_and_map(dev->of_node, 0);
if (!irq)
goto err_irq;
cppi_writel(USBSS_IRQ_PD_COMP, cdd->usbss_mem + USBSS_IRQ_ENABLER);
ret = request_irq(irq, glue_info->isr, IRQF_SHARED,
- dev_name(&pdev->dev), cdd);
+ dev_name(dev), cdd);
if (ret)
goto err_irq;
cdd->irq = irq;
@@ -994,7 +995,7 @@ static int cppi41_dma_probe(struct platform_device *pdev)
if (ret)
goto err_dma_reg;
- ret = of_dma_controller_register(pdev->dev.of_node,
+ ret = of_dma_controller_register(dev->of_node,
cppi41_dma_xlate, &cpp41_dma_info);
if (ret)
goto err_of;
@@ -1009,11 +1010,11 @@ err_irq:
cppi_writel(0, cdd->usbss_mem + USBSS_IRQ_CLEARR);
cleanup_chans(cdd);
err_chans:
- deinit_cppi41(&pdev->dev, cdd);
+ deinit_cppi41(dev, cdd);
err_init_cppi:
- pm_runtime_put(&pdev->dev);
+ pm_runtime_put(dev);
err_get_sync:
- pm_runtime_disable(&pdev->dev);
+ pm_runtime_disable(dev);
iounmap(cdd->usbss_mem);
iounmap(cdd->ctrl_mem);
iounmap(cdd->sched_mem);
--
1.8.3.1
next prev parent reply other threads:[~2013-09-22 14:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 14:49 [PATCH v3 0/5] dma: cppi41: some trivial fixes and support for suspend/resume Daniel Mack
[not found] ` <1379861404-8250-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-22 14:50 ` [PATCH v3 1/5] dma: cppi41: pass around device instead of platform_device Daniel Mack
2013-09-23 4:16 ` Vinod Koul
2013-09-22 14:50 ` [PATCH v3 2/5] dma: cppi41: s/deinit_cpii41/deinit_cppi41/ Daniel Mack
2013-09-23 4:16 ` Vinod Koul
2013-09-22 14:50 ` Daniel Mack [this message]
[not found] ` <1379861404-8250-4-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-23 4:17 ` [PATCH v3 3/5] dma: cppi41: add shortcut to &pdev->dev in cppi41_dma_probe() Vinod Koul
2013-09-22 14:50 ` [PATCH v3 4/5] dma: cppi41: only allocate descriptor memory once Daniel Mack
2013-09-23 4:17 ` Vinod Koul
[not found] ` <20130923041754.GZ17188-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-09-23 14:51 ` Sebastian Andrzej Siewior
2013-09-23 14:36 ` Vinod Koul
[not found] ` <1379861404-8250-5-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-26 8:26 ` Sebastian Andrzej Siewior
2013-10-01 13:09 ` Daniel Mack
[not found] ` <524AC987.5000301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-01 16:22 ` Sebastian Andrzej Siewior
2013-10-01 16:57 ` Daniel Mack
2013-10-02 7:13 ` Sebastian Andrzej Siewior
2013-09-22 14:50 ` [PATCH v3 5/5] dma: cppi41: add support for suspend and resume Daniel Mack
[not found] ` <1379861404-8250-6-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-23 4:09 ` Vinod Koul
2013-09-23 5:53 ` Daniel Mack
2013-09-23 10:00 ` Vinod Koul
2013-09-23 10:01 ` 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=1379861404-8250-4-git-send-email-zonque@gmail.com \
--to=zonque@gmail.com \
--cc=balbi@ti.com \
--cc=bigeasy@linutronix.de \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=neumann@teufel.de \
--cc=sergei.shtylyov@cogentembedded.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).