summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-06-26 23:36:59 +0300
committerAndy Gross <andy.gross@linaro.org>2017-08-09 01:41:23 +0300
commit445c2410a449ae29c0ec0bb9cee8f38078c4a2f1 (patch)
tree9b1aa1e785e328ada927ae46aca62b29319aa508
parent2a464815d3262e441a5cff7cbece69c0b76b14d6 (diff)
downloadlinux-445c2410a449ae29c0ec0bb9cee8f38078c4a2f1.tar.xz
soc: qcom: mdt_loader: Use request_firmware_into_buf()
By switching to the request_firmware_into_buf() we load the segment data straight into the preallocated buffers, reducing the need for allocating scratch buffers for these. In particular the modem firmware consists of multiple segments in the range 5-15MB, making this worth while. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Andy Gross <andy.gross@linaro.org>
-rw-r--r--drivers/soc/qcom/mdt_loader.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
index bd63df0d14e0..08bd8549242a 100644
--- a/drivers/soc/qcom/mdt_loader.c
+++ b/drivers/soc/qcom/mdt_loader.c
@@ -178,14 +178,13 @@ int qcom_mdt_load(struct device *dev, const struct firmware *fw,
if (phdr->p_filesz) {
sprintf(fw_name + fw_name_len - 3, "b%02d", i);
- ret = request_firmware(&seg_fw, fw_name, dev);
+ ret = request_firmware_into_buf(&seg_fw, fw_name, dev,
+ ptr, phdr->p_filesz);
if (ret) {
dev_err(dev, "failed to load %s\n", fw_name);
break;
}
- memcpy(ptr, seg_fw->data, seg_fw->size);
-
release_firmware(seg_fw);
}