summaryrefslogtreecommitdiff
path: root/drivers/staging/ozwpan/ozusbsvc.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-03 00:51:09 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-03 00:51:09 (GMT)
commit1ec41a31fb695682cab7fc7c1f6ced84d188b6f9 (patch)
tree03d080d0f0202afef3b8b445c1f817b832ddb8d5 /drivers/staging/ozwpan/ozusbsvc.c
parentcc55bb03ea17fcbeffb5ae3ec68ea1f8673bc0c8 (diff)
downloadlinux-fsl-qoriq-1ec41a31fb695682cab7fc7c1f6ced84d188b6f9.tar.xz
staging: ozwpan: remove debug allocator
The kernel already has a debug allocator, no need to have one unique to a single driver. So delete it, replace with kfree, kmalloc, and, in a few places that need it, kzalloc(). Cc: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan/ozusbsvc.c')
-rw-r--r--drivers/staging/ozwpan/ozusbsvc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/ozwpan/ozusbsvc.c b/drivers/staging/ozwpan/ozusbsvc.c
index 1da98f6..9e74f96 100644
--- a/drivers/staging/ozwpan/ozusbsvc.c
+++ b/drivers/staging/ozwpan/ozusbsvc.c
@@ -26,7 +26,6 @@
#include "ozusbif.h"
#include "ozhcd.h"
#include "oztrace.h"
-#include "ozalloc.h"
#include "ozusbsvc.h"
#include "ozevent.h"
/*------------------------------------------------------------------------------
@@ -65,11 +64,9 @@ int oz_usb_start(struct oz_pd *pd, int resume)
/* Create a USB context in case we need one. If we find the PD already
* has a USB context then we will destroy it.
*/
- usb_ctx = (struct oz_usb_ctx *)
- oz_alloc(sizeof(struct oz_usb_ctx), GFP_ATOMIC);
+ usb_ctx = kzalloc(sizeof(struct oz_usb_ctx), GFP_ATOMIC);
if (usb_ctx == 0)
- return -1;
- memset(usb_ctx, 0, sizeof(struct oz_usb_ctx));
+ return -ENOMEM;
atomic_set(&usb_ctx->ref_count, 1);
usb_ctx->pd = pd;
usb_ctx->stopped = 0;
@@ -85,7 +82,7 @@ int oz_usb_start(struct oz_pd *pd, int resume)
spin_unlock_bh(&pd->app_lock[OZ_APPID_USB-1]);
if (old_ctx) {
oz_trace("Already have USB context.\n");
- oz_free(usb_ctx);
+ kfree(usb_ctx);
usb_ctx = old_ctx;
} else if (usb_ctx) {
/* Take a reference to the PD. This will be released when
@@ -170,7 +167,7 @@ void oz_usb_put(void *hpd)
if (atomic_dec_and_test(&usb_ctx->ref_count)) {
oz_trace("Dealloc USB context.\n");
oz_pd_put(usb_ctx->pd);
- oz_free(usb_ctx);
+ kfree(usb_ctx);
}
}
/*------------------------------------------------------------------------------