aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/amiga
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2011-04-24 16:55:20 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2011-07-30 15:21:38 -0400
commitb4f6f45302a9440e26f71dab0b95906bcc3bd13a (patch)
treeb10f00f31cd0519ef6c863c8d332b1e75262715d /arch/m68k/amiga
parent5be3246306e613055505f4950411f5497d97edb0 (diff)
m68k/amiga: Chip RAM - Convert from printk() to pr_*()
and fix a few formattings: - resource sizes are now resource_size_t, use %pR to make it future proof, - use %lu for unsigned long. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/amiga')
-rw-r--r--arch/m68k/amiga/chipram.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/arch/m68k/amiga/chipram.c b/arch/m68k/amiga/chipram.c
index e757ffffbc8a..9005fa07f2e2 100644
--- a/arch/m68k/amiga/chipram.c
+++ b/arch/m68k/amiga/chipram.c
@@ -47,9 +47,7 @@ void *amiga_chip_alloc(unsigned long size, const char *name)
47 /* round up */ 47 /* round up */
48 size = PAGE_ALIGN(size); 48 size = PAGE_ALIGN(size);
49 49
50#ifdef DEBUG 50 pr_debug("amiga_chip_alloc: allocate %lu bytes\n", size);
51 printk("amiga_chip_alloc: allocate %ld bytes\n", size);
52#endif
53 res = kzalloc(sizeof(struct resource), GFP_KERNEL); 51 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
54 if (!res) 52 if (!res)
55 return NULL; 53 return NULL;
@@ -61,9 +59,7 @@ void *amiga_chip_alloc(unsigned long size, const char *name)
61 return NULL; 59 return NULL;
62 } 60 }
63 chipavail -= size; 61 chipavail -= size;
64#ifdef DEBUG 62 pr_debug("amiga_chip_alloc: returning %pR\n", res);
65 printk("amiga_chip_alloc: returning %lx\n", res->start);
66#endif
67 return (void *)ZTWO_VADDR(res->start); 63 return (void *)ZTWO_VADDR(res->start);
68} 64}
69EXPORT_SYMBOL(amiga_chip_alloc); 65EXPORT_SYMBOL(amiga_chip_alloc);
@@ -85,20 +81,16 @@ void * __init amiga_chip_alloc_res(unsigned long size, struct resource *res)
85 /* dmesg into chipmem prefers memory at the safe end */ 81 /* dmesg into chipmem prefers memory at the safe end */
86 start = CHIP_PHYSADDR + chipavail - size; 82 start = CHIP_PHYSADDR + chipavail - size;
87 83
88#ifdef DEBUG 84 pr_debug("amiga_chip_alloc_res: allocate %lu bytes\n", size);
89 printk("amiga_chip_alloc_res: allocate %ld bytes\n", size);
90#endif
91 if (allocate_resource(&chipram_res, res, size, start, UINT_MAX, 85 if (allocate_resource(&chipram_res, res, size, start, UINT_MAX,
92 PAGE_SIZE, NULL, NULL) < 0) { 86 PAGE_SIZE, NULL, NULL) < 0) {
93 printk("amiga_chip_alloc_res: first alloc failed!\n"); 87 pr_err("amiga_chip_alloc_res: first alloc failed!\n");
94 if (allocate_resource(&chipram_res, res, size, 0, UINT_MAX, 88 if (allocate_resource(&chipram_res, res, size, 0, UINT_MAX,
95 PAGE_SIZE, NULL, NULL) < 0) 89 PAGE_SIZE, NULL, NULL) < 0)
96 return NULL; 90 return NULL;
97 } 91 }
98 chipavail -= size; 92 chipavail -= size;
99#ifdef DEBUG 93 pr_debug("amiga_chip_alloc_res: returning %pR\n", res);
100 printk("amiga_chip_alloc_res: returning %lx\n", res->start);
101#endif
102 return (void *)ZTWO_VADDR(res->start); 94 return (void *)ZTWO_VADDR(res->start);
103} 95}
104 96
@@ -113,14 +105,12 @@ void amiga_chip_free(void *ptr)
113 continue; 105 continue;
114 *p = res->sibling; 106 *p = res->sibling;
115 size = res->end-start; 107 size = res->end-start;
116#ifdef DEBUG 108 pr_debug("amiga_chip_free: free %lu bytes at %p\n", size, ptr);
117 printk("amiga_chip_free: free %ld bytes at %p\n", size, ptr);
118#endif
119 chipavail += size; 109 chipavail += size;
120 kfree(res); 110 kfree(res);
121 return; 111 return;
122 } 112 }
123 printk("amiga_chip_free: trying to free nonexistent region at %p\n", 113 pr_err("amiga_chip_free: trying to free nonexistent region at %p\n",
124 ptr); 114 ptr);
125} 115}
126EXPORT_SYMBOL(amiga_chip_free); 116EXPORT_SYMBOL(amiga_chip_free);
@@ -128,9 +118,7 @@ EXPORT_SYMBOL(amiga_chip_free);
128 118
129unsigned long amiga_chip_avail(void) 119unsigned long amiga_chip_avail(void)
130{ 120{
131#ifdef DEBUG 121 pr_debug("amiga_chip_avail : %lu bytes\n", chipavail);
132 printk("amiga_chip_avail : %ld bytes\n", chipavail);
133#endif
134 return chipavail; 122 return chipavail;
135} 123}
136EXPORT_SYMBOL(amiga_chip_avail); 124EXPORT_SYMBOL(amiga_chip_avail);