aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/powertv
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-05-17 10:45:08 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-06-10 12:01:24 -0400
commit6e7582bf35b8a5a330fd08b398ae445bac86917a (patch)
treeba97ee4107f5160575e605d0a37ff6bbea7edb00 /arch/mips/powertv
parent317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff)
MIPS: PowerTV: use free_reserved_area() to simplify code
Use common help function free_reserved_area() to simplify code. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Jiang Liu <jiang.liu@huawei.com> Cc: David Rientjes <rientjes@google.com> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Minchan Kim <minchan@kernel.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Cc: David Howells <dhowells@redhat.com> Cc: Mark Salter <msalter@redhat.com> Cc: Jianguo Wu <wujianguo@huawei.com> Cc: linux-mm@kvack.org Cc: linux-arch@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/5248/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/powertv')
-rw-r--r--arch/mips/powertv/asic/asic_devices.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c
index d38b095fd0d0..9f64c2387808 100644
--- a/arch/mips/powertv/asic/asic_devices.c
+++ b/arch/mips/powertv/asic/asic_devices.c
@@ -529,17 +529,8 @@ EXPORT_SYMBOL(asic_resource_get);
529 */ 529 */
530void platform_release_memory(void *ptr, int size) 530void platform_release_memory(void *ptr, int size)
531{ 531{
532 unsigned long addr; 532 free_reserved_area((unsigned long)ptr, (unsigned long)(ptr + size),
533 unsigned long end; 533 -1, NULL);
534
535 addr = ((unsigned long)ptr + (PAGE_SIZE - 1)) & PAGE_MASK;
536 end = ((unsigned long)ptr + size) & PAGE_MASK;
537
538 for (; addr < end; addr += PAGE_SIZE) {
539 ClearPageReserved(virt_to_page(__va(addr)));
540 init_page_count(virt_to_page(__va(addr)));
541 free_page((unsigned long)__va(addr));
542 }
543} 534}
544EXPORT_SYMBOL(platform_release_memory); 535EXPORT_SYMBOL(platform_release_memory);
545 536