From: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: [PATCH v2 2/3] dmaengine: imx-sdma: sdma_get_firmware does not need to copy fw_name
Date: Fri, 15 Jul 2011 17:44:25 +0800 [thread overview]
Message-ID: <1310723066-567-3-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1310723066-567-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
It does not need to allocate space and copy fw_name in function
sdma_get_firmware().
Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
drivers/dma/imx-sdma.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 4a7aa72..6b839a2 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1125,22 +1125,14 @@ static int __init sdma_get_firmware(struct sdma_engine *sdma,
const char *fw_name)
{
const struct firmware *fw;
- char *fwname;
const struct sdma_firmware_header *header;
int ret;
const struct sdma_script_start_addrs *addr;
unsigned short *ram_code;
- fwname = kasprintf(GFP_KERNEL, "%s", fw_name);
- if (!fwname)
- return -ENOMEM;
-
- ret = request_firmware(&fw, fwname, sdma->dev);
- if (ret) {
- kfree(fwname);
+ ret = request_firmware(&fw, fw_name, sdma->dev);
+ if (ret)
return ret;
- }
- kfree(fwname);
if (fw->size < sizeof(*header))
goto err_firmware;
--
1.7.4.1
next prev parent reply other threads:[~2011-07-15 9:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 9:44 [PATCH v2 0/3] Add device tree probe for imx-sdma driver Shawn Guo
[not found] ` <1310723066-567-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-07-15 9:44 ` [PATCH v2 1/3] dmaengine: imx-sdma: use platform_device_id to identify sdma version Shawn Guo
[not found] ` <1310723066-567-2-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-09-05 9:16 ` Uwe Kleine-König
2011-07-15 9:44 ` Shawn Guo [this message]
2011-09-05 9:20 ` [PATCH v2 2/3] dmaengine: imx-sdma: sdma_get_firmware does not need to copy fw_name Uwe Kleine-König
2011-07-15 9:44 ` [PATCH v2 3/3] dmaengine: imx-sdma: add device tree probe support Shawn Guo
2011-08-04 3:57 ` Koul, Vinod
2011-08-25 13:37 ` Koul, Vinod
2011-08-30 1:45 ` Shawn Guo
2011-09-05 9:24 ` Uwe Kleine-König
2011-07-22 3:54 ` [PATCH v2 0/3] Add device tree probe for imx-sdma driver Shawn Guo
2011-07-25 11:41 ` Vinod Koul
2011-07-25 15:19 ` Shawn Guo
2011-08-04 3:59 ` Koul, Vinod
2011-08-04 5:35 ` Shawn Guo
2011-08-04 5:28 ` Koul, Vinod
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=1310723066-567-3-git-send-email-shawn.guo@linaro.org \
--to=shawn.guo-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).