diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-02 16:51:09 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-02 16:51:09 -0800 |
commit | 1ec41a31fb695682cab7fc7c1f6ced84d188b6f9 (patch) | |
tree | 03d080d0f0202afef3b8b445c1f817b832ddb8d5 /drivers/staging/ozwpan/ozcdev.c | |
parent | cc55bb03ea17fcbeffb5ae3ec68ea1f8673bc0c8 (diff) |
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/ozcdev.c')
-rw-r--r-- | drivers/staging/ozwpan/ozcdev.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c index 912c964cb55..1c380d68796 100644 --- a/drivers/staging/ozwpan/ozcdev.c +++ b/drivers/staging/ozwpan/ozcdev.c @@ -17,7 +17,6 @@ #include "ozeltbuf.h" #include "ozpd.h" #include "ozproto.h" -#include "ozalloc.h" #include "ozevent.h" /*------------------------------------------------------------------------------ */ @@ -66,7 +65,7 @@ static void oz_cdev_release_ctx(struct oz_serial_ctx *ctx) { if (atomic_dec_and_test(&ctx->ref_count)) { oz_trace("Dealloc serial context.\n"); - oz_free(ctx); + kfree(ctx); } } /*------------------------------------------------------------------------------ @@ -400,18 +399,16 @@ int oz_cdev_start(struct oz_pd *pd, int resume) oz_trace("Serial service resumed.\n"); return 0; } - ctx = (struct oz_serial_ctx *) - oz_alloc(sizeof(struct oz_serial_ctx), GFP_ATOMIC); + ctx = kzalloc(sizeof(struct oz_serial_ctx), GFP_ATOMIC); if (ctx == 0) - return -1; - memset(ctx, 0, sizeof(struct oz_serial_ctx)); + return -ENOMEM; atomic_set(&ctx->ref_count, 1); ctx->tx_seq_num = 1; spin_lock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]); old_ctx = pd->app_ctx[OZ_APPID_SERIAL-1]; if (old_ctx) { spin_unlock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]); - oz_free(ctx); + kfree(ctx); } else { pd->app_ctx[OZ_APPID_SERIAL-1] = ctx; spin_unlock_bh(&pd->app_lock[OZ_APPID_SERIAL-1]); |