Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168AbdHILCh (ORCPT ); Wed, 9 Aug 2017 07:02:37 -0400 Received: from m12-13.163.com ([220.181.12.13]:55932 "EHLO m12-13.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751890AbdHILCf (ORCPT ); Wed, 9 Aug 2017 07:02:35 -0400 From: Pan Bian To: Greg Kroah-Hartman , Dmitry Torokhov , Guenter Roeck , Wei-Ning Huang , Christophe JAILLET , Wei Yongjun Cc: linux-kernel@vger.kernel.org, Pan Bian Subject: [V2] firmware: vpd: use memunmap instead of iounmap Date: Wed, 9 Aug 2017 19:01:47 +0800 Message-Id: <1502276507-11921-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: DcCowAB3ZW6164pZ51tPDg--.21683S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7CF47WF18Xr4ktFy5ZFW8WFg_yoW8WrWrpF W7GFWxCr17Jw48ZwnrJw4DuFyYvFW8JFy7uFy7Z343A3ZxurW0kFyrKFyq9rWakrWfZa47 Xa18ua1UX3WUAwUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jqCJPUUUUU= X-Originating-IP: [1.202.67.190] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/xtbBzxovclaDvF+5NwAAsw Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1543 Lines: 54 In functions vpd_sections_init() and vpd_section_init(), iounmap() is used to unmap memory. However, in these cases, memunmap() should be used. Signed-off-by: Pan Bian --- drivers/firmware/google/vpd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c index 7894572..35e553b 100644 --- a/drivers/firmware/google/vpd.c +++ b/drivers/firmware/google/vpd.c @@ -202,7 +202,7 @@ static int vpd_section_init(const char *name, struct vpd_section *sec, sec->raw_name = kasprintf(GFP_KERNEL, "%s_raw", name); if (!sec->raw_name) { err = -ENOMEM; - goto err_iounmap; + goto err_memunmap; } sysfs_bin_attr_init(&sec->bin_attr); @@ -233,8 +233,8 @@ static int vpd_section_init(const char *name, struct vpd_section *sec, sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr); err_free_raw_name: kfree(sec->raw_name); -err_iounmap: - iounmap(sec->baseaddr); +err_memunmap: + memunmap(sec->baseaddr); return err; } @@ -245,7 +245,7 @@ static int vpd_section_destroy(struct vpd_section *sec) kobject_put(sec->kobj); sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr); kfree(sec->raw_name); - iounmap(sec->baseaddr); + memunmap(sec->baseaddr); } return 0; @@ -262,7 +262,7 @@ static int vpd_sections_init(phys_addr_t physaddr) return -ENOMEM; memcpy_fromio(&header, temp, sizeof(struct vpd_cbmem)); - iounmap(temp); + memunmap(temp); if (header.magic != VPD_CBMEM_MAGIC) return -ENODEV; -- 1.9.1