From: Russell King <rmk+kernel@arm.linux.org.uk>
To: dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead,
org@arm.linux.org.uk, linux-omap@vger.kernel.org
Cc: Vinod Koul <vinod.koul@intel.com>,
Dan Williams <dan.j.williams@intel.com>
Subject: [PATCH RFC 01/26] dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev.
Date: Thu, 02 Jan 2014 15:07:01 +0000 [thread overview]
Message-ID: <E1VyjrR-0004zN-P4@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20140102150621.GJ16456@n2100.arm.linux.org.uk>
Use devm_kzalloc() to allocate omap_dmadev() so that we don't need
complex error cleanup paths.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
drivers/dma/omap-dma.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index 2f66cf4e54fe..d9349be33bdf 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -594,7 +594,6 @@ static void omap_dma_free(struct omap_dmadev *od)
tasklet_kill(&c->vc.task);
kfree(c);
}
- kfree(od);
}
static int omap_dma_probe(struct platform_device *pdev)
@@ -602,7 +601,7 @@ static int omap_dma_probe(struct platform_device *pdev)
struct omap_dmadev *od;
int rc, i;
- od = kzalloc(sizeof(*od), GFP_KERNEL);
+ od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
if (!od)
return -ENOMEM;
--
1.7.4.4
next prev parent reply other threads:[~2014-01-02 15:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 15:06 [PATCH RFC 00/26] Migrate more OMAP DMA code to DMA engine Russell King - ARM Linux
2014-01-02 15:07 ` Russell King [this message]
2014-01-02 15:07 ` [PATCH RFC 02/26] dmaengine: omap-dma: provide a hook to get the underlying DMA platform ops Russell King
2014-01-02 15:07 ` [PATCH RFC 03/26] dmaengine: omap-dma: program hardware directly Russell King
2014-01-02 15:07 ` [PATCH RFC 04/26] dmaengine: omap-dma: consolidate writes to DMA registers Russell King
2014-01-10 12:16 ` [PATCH RFC 00/26] Migrate more OMAP DMA code to DMA engine Sricharan R
2014-01-13 14:17 ` Russell King - ARM Linux
2014-01-17 14:23 ` Sricharan R
-- strict thread matches above, loose matches on Subject: below --
2014-01-02 15:08 Russell King - ARM Linux
2014-01-02 15:08 ` [PATCH RFC 01/26] dmaengine: omap-dma: use devm_kzalloc() to allocate omap_dmadev Russell King
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=E1VyjrR-0004zN-P4@rmk-PC.arm.linux.org.uk \
--to=rmk+kernel@arm.linux.org.uk \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead \
--cc=linux-omap@vger.kernel.org \
--cc=org@arm.linux.org.uk \
--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).