diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-07-15 05:25:28 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2011-07-26 21:31:51 -0400 |
commit | 40ad5b37914368a4f2c5ff1e72712375d6f1188b (patch) | |
tree | 8e9c226043d461578b11c2e26e358e4c0eed2fd5 /drivers/dma/imx-sdma.c | |
parent | 62550cd7c08f1a38d0ade1de18baec10f83412bb (diff) |
dmaengine: imx-sdma: sdma_get_firmware does not need to copy fw_name
It does not need to allocate space and copy fw_name in function
sdma_get_firmware().
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/imx-sdma.c')
-rw-r--r-- | 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 a7708b481eab..df400691f9a0 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
@@ -1126,22 +1126,14 @@ static int __init sdma_get_firmware(struct sdma_engine *sdma, | |||
1126 | const char *fw_name) | 1126 | const char *fw_name) |
1127 | { | 1127 | { |
1128 | const struct firmware *fw; | 1128 | const struct firmware *fw; |
1129 | char *fwname; | ||
1130 | const struct sdma_firmware_header *header; | 1129 | const struct sdma_firmware_header *header; |
1131 | int ret; | 1130 | int ret; |
1132 | const struct sdma_script_start_addrs *addr; | 1131 | const struct sdma_script_start_addrs *addr; |
1133 | unsigned short *ram_code; | 1132 | unsigned short *ram_code; |
1134 | 1133 | ||
1135 | fwname = kasprintf(GFP_KERNEL, "%s", fw_name); | 1134 | ret = request_firmware(&fw, fw_name, sdma->dev); |
1136 | if (!fwname) | 1135 | if (ret) |
1137 | return -ENOMEM; | ||
1138 | |||
1139 | ret = request_firmware(&fw, fwname, sdma->dev); | ||
1140 | if (ret) { | ||
1141 | kfree(fwname); | ||
1142 | return ret; | 1136 | return ret; |
1143 | } | ||
1144 | kfree(fwname); | ||
1145 | 1137 | ||
1146 | if (fw->size < sizeof(*header)) | 1138 | if (fw->size < sizeof(*header)) |
1147 | goto err_firmware; | 1139 | goto err_firmware; |