diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2013-07-29 11:47:05 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2013-08-23 07:29:50 +0800 |
commit | ec6f48bb07beba9de216bd86046286571109b92a (patch) | |
tree | dd321b021b1d737074c4e93740318d32f5e755b7 /drivers/mxc | |
parent | 8647851f531d6e4c66fe8041a92975e0064119b8 (diff) |
ENGR00240988: gpu: fix deprecated idr calls on 3.10 kernel
The idr calls idr_pre_get() and idr_get_new_above() are deprecated on
3.10 kernel and cause the following build issues. Replace the calls
with the new idr_alloc() to fix the issue.
CC drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.o
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c: In function ‘_AllocateIntegerId’:
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:776:5: error: ‘idr_pre_get’ is deprecated (declared at include/linux/idr.h:151) [-Werror=deprecated-declarations]
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:784:5: error: ‘idr_get_new_above’ is deprecated (declared at include/linux/idr.h:166) [-Werror=deprecated-declarations]
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'drivers/mxc')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c index f82fe4be2cca..f21651660395 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c @@ -772,6 +772,18 @@ _AllocateIntegerId( { int result; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) + spin_lock(&Database->lock); + /* Try to get a id greater than 0. */ + result = idr_alloc(&Database->idr, KernelPointer, 1, 0, + GFP_KERNEL | gcdNOWARN); + spin_unlock(&Database->lock); + + if (result < 0) + return gcvSTATUS_OUT_OF_RESOURCES; + + *Id = result; +#else again: if (idr_pre_get(&Database->idr, GFP_KERNEL | gcdNOWARN) == 0) { @@ -794,6 +806,7 @@ again: { return gcvSTATUS_OUT_OF_RESOURCES; } +#endif return gcvSTATUS_OK; } |