MIPS: PowerTV: use free_reserved_area() to simplify code
authorJiang Liu <[email protected]>
Fri, 17 May 2013 14:45:08 +0000 (14:45 +0000)
committerRalf Baechle <[email protected]>
Mon, 10 Jun 2013 16:01:24 +0000 (18:01 +0200)
Use common help function free_reserved_area() to simplify code.

Signed-off-by: Jiang Liu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Andrew Morton <[email protected]>
Cc: Jiang Liu <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Wen Congyang <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Howells <[email protected]>
Cc: Mark Salter <[email protected]>
Cc: Jianguo Wu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/5248/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/powertv/asic/asic_devices.c

index d38b095fd0d045a1f103eff45f9ad3f9278bb903..9f64c23878082c7e5622733486652381af0315b4 100644 (file)
@@ -529,17 +529,8 @@ EXPORT_SYMBOL(asic_resource_get);
  */
 void platform_release_memory(void *ptr, int size)
 {
-       unsigned long addr;
-       unsigned long end;
-
-       addr = ((unsigned long)ptr + (PAGE_SIZE - 1)) & PAGE_MASK;
-       end = ((unsigned long)ptr + size) & PAGE_MASK;
-
-       for (; addr < end; addr += PAGE_SIZE) {
-               ClearPageReserved(virt_to_page(__va(addr)));
-               init_page_count(virt_to_page(__va(addr)));
-               free_page((unsigned long)__va(addr));
-       }
+       free_reserved_area((unsigned long)ptr, (unsigned long)(ptr + size),
+                          -1, NULL);
 }
 EXPORT_SYMBOL(platform_release_memory);