diff options
author | Timur Tabi <timur@freescale.com> | 2007-05-08 15:46:36 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-05-10 00:01:43 -0400 |
commit | 4c35630ccda56ed494f6102d2e147fefe14b78d2 (patch) | |
tree | 4f04754fb0ec6978923b3c1e0318997e420f6551 /drivers/serial/cpm_uart/cpm_uart_cpm2.c | |
parent | 742226c579c573c24386aaf41969a01ee058b97e (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/cpm_uart_cpm2.c')
-rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_cpm2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index fa455996ad8..1eeea368071 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; |