Commit c3c080ba authored by Patrick Mochel's avatar Patrick Mochel

[Power Mgmt] Remove pmdisk_free()

- Change name of free_suspend_pagedir() to swsusp_free().
- Call from kernel/power/disk.c
parent c2cd403c
......@@ -27,7 +27,7 @@ extern int swsusp_suspend(void);
extern int swsusp_write(void);
extern int swsusp_read(void);
extern int swsusp_resume(void);
extern int pmdisk_free(void);
extern int swsusp_free(void);
/**
......@@ -180,7 +180,7 @@ int pm_suspend_disk(void)
}
} else
pr_debug("PM: Image restored successfully.\n");
pmdisk_free();
swsusp_free();
Done:
finish();
return error;
......@@ -231,7 +231,7 @@ static int pm_resume(void)
pr_debug("PM: Restore failed, recovering.n");
finish();
Free:
pmdisk_free();
swsusp_free();
Done:
pr_debug("PM: Resume from disk failed.\n");
return 0;
......
......@@ -42,18 +42,6 @@ extern suspend_pagedir_t *pagedir_save;
*/
/**
* pmdisk_free - Free memory allocated to hold snapshot.
*/
int pmdisk_free(void)
{
extern void free_suspend_pagedir(unsigned long this_pagedir);
pr_debug( "Freeing prev allocated pagedir\n" );
free_suspend_pagedir((unsigned long)pagedir_save);
return 0;
}
static int __init pmdisk_setup(char *str)
{
if (strlen(str)) {
......
......@@ -656,14 +656,15 @@ static void free_suspend_pagedir_zone(struct zone *zone, unsigned long pagedir)
}
}
void free_suspend_pagedir(unsigned long this_pagedir)
void swsusp_free(void)
{
unsigned long p = (unsigned long)pagedir_save;
struct zone *zone;
for_each_zone(zone) {
if (!is_highmem(zone))
free_suspend_pagedir_zone(zone, this_pagedir);
free_suspend_pagedir_zone(zone, p);
}
free_pages(this_pagedir, pagedir_order);
free_pages(p, pagedir_order);
}
static int prepare_suspend_processes(void)
......@@ -816,7 +817,7 @@ static int swsusp_alloc(void)
}
if ((error = alloc_image_pages())) {
pr_debug("suspend: Allocating image pages failed.\n");
free_suspend_pagedir((unsigned long)pagedir_save);
swsusp_free();
return error;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment