aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/cpm_uart
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2007-05-08 15:46:36 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-05-10 00:01:43 -0400
commit4c35630ccda56ed494f6102d2e147fefe14b78d2 (patch)
tree4f04754fb0ec6978923b3c1e0318997e420f6551 /drivers/serial/cpm_uart
parent742226c579c573c24386aaf41969a01ee058b97e (diff)
[POWERPC] Change rheap functions to use ulongs instead of pointers
The rheap allocation functions return a pointer, but the actual value is based on how the heap was initialized, and so it can be anything, e.g. an offset into a buffer. A ulong is a better representation of the value returned by the allocation functions. This patch changes all of the relevant rheap functions to use a unsigned long integers instead of a pointer. In case of an error, the value returned is a negative error code that has been cast to an unsigned long. The caller can use the IS_ERR_VALUE() macro to check for this. All code which calls the rheap functions is updated accordingly. Macros IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE(). Also added error checking to rh_attach_region(). Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'drivers/serial/cpm_uart')
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.c4
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 925fb607d8c4..bb7afe985c63 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -125,7 +125,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
125{ 125{
126 int dpmemsz, memsz; 126 int dpmemsz, memsz;
127 u8 *dp_mem; 127 u8 *dp_mem;
128 uint dp_offset; 128 unsigned long dp_offset;
129 u8 *mem_addr; 129 u8 *mem_addr;
130 dma_addr_t dma_addr = 0; 130 dma_addr_t dma_addr = 0;
131 131
@@ -133,7 +133,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
133 133
134 dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos); 134 dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
135 dp_offset = cpm_dpalloc(dpmemsz, 8); 135 dp_offset = cpm_dpalloc(dpmemsz, 8);
136 if (IS_DPERR(dp_offset)) { 136 if (IS_ERR_VALUE(dp_offset)) {
137 printk(KERN_ERR 137 printk(KERN_ERR
138 "cpm_uart_cpm1.c: could not allocate buffer descriptors\n"); 138 "cpm_uart_cpm1.c: could not allocate buffer descriptors\n");
139 return -ENOMEM; 139 return -ENOMEM;
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index fa455996ad8f..1eeea368071a 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -222,7 +222,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
222{ 222{
223 int dpmemsz, memsz; 223 int dpmemsz, memsz;
224 u8 *dp_mem; 224 u8 *dp_mem;
225 uint dp_offset; 225 unsigned long dp_offset;
226 u8 *mem_addr; 226 u8 *mem_addr;
227 dma_addr_t dma_addr = 0; 227 dma_addr_t dma_addr = 0;
228 228
@@ -230,7 +230,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
230 230
231 dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos); 231 dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
232 dp_offset = cpm_dpalloc(dpmemsz, 8); 232 dp_offset = cpm_dpalloc(dpmemsz, 8);
233 if (IS_DPERR(dp_offset)) { 233 if (IS_ERR_VALUE(dp_offset)) {
234 printk(KERN_ERR 234 printk(KERN_ERR
235 "cpm_uart_cpm.c: could not allocate buffer descriptors\n"); 235 "cpm_uart_cpm.c: could not allocate buffer descriptors\n");
236 return -ENOMEM; 236 return -ENOMEM;