aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-01-12 10:58:12 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-07-24 12:04:46 +0200
commit8cff2f6bbc6ce9f69aaf3d159f8e75e806f8bf8d (patch)
treeb5ee2b56e84d3e43a4a4f69a0cd242b0580bac4d
parentc6c8427a50bdce7c81853c2e493da813e26c611a (diff)
downloadkernel_samsung_smdk4412-8cff2f6bbc6ce9f69aaf3d159f8e75e806f8bf8d.zip
kernel_samsung_smdk4412-8cff2f6bbc6ce9f69aaf3d159f8e75e806f8bf8d.tar.gz
kernel_samsung_smdk4412-8cff2f6bbc6ce9f69aaf3d159f8e75e806f8bf8d.tar.bz2
S5C73M3: System firmware loading correction using static memory array
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--drivers/media/video/s5c73m3.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/media/video/s5c73m3.c b/drivers/media/video/s5c73m3.c
index 3d24612..3529ad3 100644
--- a/drivers/media/video/s5c73m3.c
+++ b/drivers/media/video/s5c73m3.c
@@ -2681,7 +2681,6 @@ static int s5c73m3_load_fw(struct v4l2_subdev *sd)
const struct firmware *fw;
char fw_path[20] = {0,};
char fw_path_in_data[25] = {0,};
- u8 *buf = NULL;
int err = 0;
int txSize = 0;
@@ -2751,30 +2750,25 @@ static int s5c73m3_load_fw(struct v4l2_subdev *sd)
}
/*cam_dbg("start, size %d Bytes\n", fw->size);*/
- buf = (u8 *)fw->data;
+ memcpy((void *) &data_memory, (void *) fw->data, fw->size);
fsize = fw->size;
}
txSize = 60*1024; /*60KB*/
- if (state->fw_index != S5C73M3_IN_SYSTEM) {
- err = s5c73m3_spi_write((char *)&data_memory,
- fsize, txSize);
- if (err < 0) {
- cam_err("s5c73m3_spi_write falied\n");
- goto out;
- }
- } else {
- err = s5c73m3_spi_write((char *)buf, fsize, txSize);
+ err = s5c73m3_spi_write((char *)&data_memory,
+ fsize, txSize);
+ if (err < 0) {
+ cam_err("s5c73m3_spi_write falied\n");
+ goto out;
}
+
out:
if (state->fw_index == S5C73M3_SD_CARD ||
state->fw_index == S5C73M3_IN_DATA) {
if (!IS_ERR(fp) && fp != NULL)
filp_close(fp, current->files);
- vfree(buf);
-
set_fs(old_fs);
} else {
release_firmware(fw);