firmware: vpd: use memunmap instead of iounmap
PATCH v3 1/1 firmware: vpd: use memunmap instead of iounmap
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 <[email protected]>
---
V2: change error label err_iounmap to err_memunmap
V3: add changes from V1 to V2
--- drivers/firmware/google/vpd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/firmware/google/vpd.c +5 -5
@@ -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 ;
Signature · 1 line
1.9.1
Quoted 5 lines · Pan Bian
In functions
vpd_sections_init()andvpd_section_init(),iounmap()is used to unmap memory. However, in these cases,memunmap()should be used.Signed-off-by Pan Bian <[email protected]>
Reviewed-by Dmitry Torokhov <[email protected]>
Quoted 53 lines
---
V2: change error labelerr_iounmaptoerr_memunmap
V3: add changes from V1 to V2--- drivers/firmware/google/vpd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/firmware/google/vpd.c +5
-5@@ -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 ;Signature · 1 line
1.9.1
Signature · 1 line
Dmitry