From 5571c4ad8640cc3aa9410d6d81f8d9aabc3422ef Mon Sep 17 00:00:00 2001 From: Nurit Lichtenstein Date: Sat, 25 Apr 2020 21:42:25 +0300 Subject: [PATCH] soc: qcom: spss_utils: Modify memory unmapping scheme for cmac_mem IAR maps cmac_mem once and assumes it is mapped from this moment onward. Therefore, move the the call to iounmap(cmac_mem) to the remove() function. Change-Id: I5afa3de900e4766520c106882e2485d6c335c54d Signed-off-by: Nurit Lichtenstein --- drivers/soc/qcom/spss_utils.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/spss_utils.c b/drivers/soc/qcom/spss_utils.c index d728e4950872..608547913422 100644 --- a/drivers/soc/qcom/spss_utils.c +++ b/drivers/soc/qcom/spss_utils.c @@ -820,9 +820,8 @@ static int spss_set_fw_cmac(u32 *cmac, size_t cmac_size) writel_relaxed(cmac[i], reg + i*sizeof(u32)); pr_debug("cmac[%d] [0x%x]\n", i, cmac[i]); } - reg += cmac_size; - iounmap(cmac_mem); + reg += cmac_size; return 0; } @@ -1057,6 +1056,11 @@ static int spss_remove(struct platform_device *pdev) kfree(spss_utils_dev); spss_utils_dev = 0; + if (cmac_mem != NULL) { + iounmap(cmac_mem); + cmac_mem = NULL; + } + return 0; }