diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-20 23:41:09 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-20 23:41:09 (GMT) |
commit | 786eeeb3756e7fb08174c3a136c16462ccd541d1 (patch) | |
tree | 9b7621b4448768f8f950e80a1bba468652608f1c /drivers/staging/csr/ul_int.c | |
parent | 55a27055b9ea5aabf8206ed6b7777c79f4e840c3 (diff) | |
download | linux-fsl-qoriq-786eeeb3756e7fb08174c3a136c16462ccd541d1.tar.xz |
staging: csr: remove CsrPmemAlloc
It's just a wrapper around kmalloc(, GFP_KERNEL) + a call to panic() if
we are out of memory, which is a very foolish thing to do (the panic
that is.)
So replace it with calls to kmalloc() and ignore the out-of-memory
casese for now, odds are it will not be hit, and if it does, hey, we
will end up panicing just the same as with the old code.
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/csr/ul_int.c')
-rw-r--r-- | drivers/staging/csr/ul_int.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/csr/ul_int.c b/drivers/staging/csr/ul_int.c index d8a728b..46d3507 100644 --- a/drivers/staging/csr/ul_int.c +++ b/drivers/staging/csr/ul_int.c @@ -105,15 +105,14 @@ ul_register_client(unifi_priv_t *priv, unsigned int configuration, ul_clients[id].configuration = configuration; /* Allocate memory for the reply signal.. */ - ul_clients[id].reply_signal = (CSR_SIGNAL*) CsrPmemAlloc(sizeof(CSR_SIGNAL)); + ul_clients[id].reply_signal = kmalloc(sizeof(CSR_SIGNAL), GFP_KERNEL); if (ul_clients[id].reply_signal == NULL) { unifi_error(priv, "Failed to allocate reply signal for client.\n"); return NULL; } /* .. and the bulk data of the reply signal. */ for (ref = 0; ref < UNIFI_MAX_DATA_REFERENCES; ref ++) { - ul_clients[id].reply_bulkdata[ref] = - (bulk_data_t*) CsrPmemAlloc(sizeof(bulk_data_t)); + ul_clients[id].reply_bulkdata[ref] = kmalloc(sizeof(bulk_data_t), GFP_KERNEL); /* If allocation fails, free allocated memory. */ if (ul_clients[id].reply_bulkdata[ref] == NULL) { for (; ref > 0; ref --) { |