diff options
| author | Timur Tabi <timur@freescale.com> | 2007-05-08 14:46:36 -0500 | 
|---|---|---|
| committer | Kumar Gala <galak@kernel.crashing.org> | 2007-05-09 23:01:43 -0500 | 
| commit | 4c35630ccda56ed494f6102d2e147fefe14b78d2 (patch) | |
| tree | 4f04754fb0ec6978923b3c1e0318997e420f6551 /arch/powerpc/sysdev/qe_lib/ucc_slow.c | |
| parent | 742226c579c573c24386aaf41969a01ee058b97e (diff) | |
| download | olio-linux-3.10-4c35630ccda56ed494f6102d2e147fefe14b78d2.tar.xz olio-linux-3.10-4c35630ccda56ed494f6102d2e147fefe14b78d2.zip  | |
[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 'arch/powerpc/sysdev/qe_lib/ucc_slow.c')
| -rw-r--r-- | arch/powerpc/sysdev/qe_lib/ucc_slow.c | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c index b930d686a4d..1f65c26ce63 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c +++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c @@ -18,6 +18,7 @@  #include <linux/slab.h>  #include <linux/stddef.h>  #include <linux/interrupt.h> +#include <linux/err.h>  #include <asm/io.h>  #include <asm/immap_qe.h> @@ -175,7 +176,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc  	/* Get PRAM base */  	uccs->us_pram_offset =  		qe_muram_alloc(UCC_SLOW_PRAM_SIZE, ALIGNMENT_OF_UCC_SLOW_PRAM); -	if (IS_MURAM_ERR(uccs->us_pram_offset)) { +	if (IS_ERR_VALUE(uccs->us_pram_offset)) {  		printk(KERN_ERR "%s: cannot allocate MURAM for PRAM", __FUNCTION__);  		ucc_slow_free(uccs);  		return -ENOMEM; @@ -210,7 +211,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc  	uccs->rx_base_offset =  		qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),  				QE_ALIGNMENT_OF_BD); -	if (IS_MURAM_ERR(uccs->rx_base_offset)) { +	if (IS_ERR_VALUE(uccs->rx_base_offset)) {  		printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__);  		uccs->rx_base_offset = 0;  		ucc_slow_free(uccs); @@ -220,7 +221,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc  	uccs->tx_base_offset =  		qe_muram_alloc(us_info->tx_bd_ring_len * sizeof(struct qe_bd),  			QE_ALIGNMENT_OF_BD); -	if (IS_MURAM_ERR(uccs->tx_base_offset)) { +	if (IS_ERR_VALUE(uccs->tx_base_offset)) {  		printk(KERN_ERR "%s: cannot allocate TX BDs", __FUNCTION__);  		uccs->tx_base_offset = 0;  		ucc_slow_free(uccs);  |