From patchwork Fri Jul 15 09:44:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2711 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5D45123F44 for ; Fri, 15 Jul 2011 09:33:00 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 2CC58A186D9 for ; Fri, 15 Jul 2011 09:33:00 +0000 (UTC) Received: by mail-qw0-f52.google.com with SMTP id 8so734711qwb.11 for ; Fri, 15 Jul 2011 02:33:00 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr2499899qcc.148.1310722379912; Fri, 15 Jul 2011 02:32:59 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs42225qcb; Fri, 15 Jul 2011 02:32:59 -0700 (PDT) Received: by 10.42.172.198 with SMTP id o6mr3753359icz.50.1310722379158; Fri, 15 Jul 2011 02:32:59 -0700 (PDT) Received: from mail-iw0-f178.google.com (mail-iw0-f178.google.com [209.85.214.178]) by mx.google.com with ESMTPS id p3si3188586icc.102.2011.07.15.02.32.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jul 2011 02:32:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.214.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.214.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iwc10 with SMTP id 10so1091500iwc.37 for ; Fri, 15 Jul 2011 02:32:57 -0700 (PDT) Received: by 10.43.47.1 with SMTP id uq1mr3684702icb.134.1310722377292; Fri, 15 Jul 2011 02:32:57 -0700 (PDT) Received: from localhost.localdomain ([121.236.240.37]) by mx.google.com with ESMTPS id hq1sm1196559icc.2.2011.07.15.02.32.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jul 2011 02:32:56 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Cc: devicetree-discuss@lists.ozlabs.org, patches@linaro.org, Shawn Guo , Vinod Koul , Sascha Hauer 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 Message-Id: <1310723066-567-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1310723066-567-1-git-send-email-shawn.guo@linaro.org> References: <1310723066-567-1-git-send-email-shawn.guo@linaro.org> It does not need to allocate space and copy fw_name in function sdma_get_firmware(). Signed-off-by: Shawn Guo Cc: Vinod Koul Cc: Sascha Hauer Acked-by: Uwe Kleine-König --- 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;