summaryrefslogtreecommitdiff
path: root/drivers/staging/brcm80211/phy
diff options
context:
space:
mode:
authormike.rapoport@gmail.com <mike.rapoport@gmail.com>2010-10-13 00:09:10 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-14 12:28:58 -0700
commit5fcc1fcb2ec18094b3a8022b1974c0b2e9f5f73c (patch)
treec60c70596d4dcc69e23a1830b4e60e5c3f262787 /drivers/staging/brcm80211/phy
parent97e17d0e7bb861c197e50433325bf2f5f9871f90 (diff)
staging: brcm80211: replace MALLOC() with k[zm]alloc
Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/brcm80211/phy')
-rw-r--r--drivers/staging/brcm80211/phy/wlc_phy_cmn.c6
-rw-r--r--drivers/staging/brcm80211/phy/wlc_phy_lcn.c13
-rw-r--r--drivers/staging/brcm80211/phy/wlc_phy_n.c6
3 files changed, 10 insertions, 15 deletions
diff --git a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
index 330be079202c..b6acaa003a13 100644
--- a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
+++ b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
@@ -555,11 +555,10 @@ shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
{
shared_phy_t *sh;
- sh = (shared_phy_t *) MALLOC(shp->osh, sizeof(shared_phy_t));
+ sh = kzalloc(sizeof(shared_phy_t), GFP_ATOMIC);
if (sh == NULL) {
return NULL;
}
- bzero((char *)sh, sizeof(shared_phy_t));
sh->osh = shp->osh;
sh->sih = shp->sih;
@@ -633,11 +632,10 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars
return &pi->pubpi_ro;
}
- pi = (phy_info_t *) MALLOC(osh, sizeof(phy_info_t));
+ pi = kzalloc(sizeof(phy_info_t), GFP_ATOMIC);
if (pi == NULL) {
return NULL;
}
- bzero((char *)pi, sizeof(phy_info_t));
pi->regs = (d11regs_t *) regs;
pi->sh = sh;
pi->phy_init_por = true;
diff --git a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
index ad179791e97b..07ae123b12c7 100644
--- a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
+++ b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
@@ -1882,7 +1882,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
if (NORADIO_ENAB(pi->pubpi))
return;
- values_to_save = MALLOC(pi->sh->osh, sizeof(u16) * 20);
+ values_to_save = kmalloc(sizeof(u16) * 20, GFP_ATOMIC);
if (NULL == values_to_save) {
return;
}
@@ -3289,7 +3289,7 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const lcnphy_rx_iqcomp_t *iqcomp,
s16 *ptr;
phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
- ptr = MALLOC(pi->sh->osh, sizeof(s16) * 131);
+ ptr = kmalloc(sizeof(s16) * 131, GFP_ATOMIC);
if (NULL == ptr) {
return false;
}
@@ -4038,12 +4038,12 @@ wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)
u16 *phy_c32;
phy_c21 = 0;
phy_c10 = phy_c13 = phy_c14 = phy_c8 = 0;
- ptr = MALLOC(pi->sh->osh, sizeof(s16) * 131);
+ ptr = kmalloc(sizeof(s16) * 131, GFP_ATOMIC);
if (NULL == ptr) {
return;
}
- phy_c32 = MALLOC(pi->sh->osh, sizeof(u16) * 20);
+ phy_c32 = kmalloc(sizeof(u16) * 20, GFP_ATOMIC);
if (NULL == phy_c32) {
return;
}
@@ -5054,13 +5054,10 @@ bool wlc_phy_attach_lcnphy(phy_info_t *pi)
{
phy_info_lcnphy_t *pi_lcn;
- pi->u.pi_lcnphy =
- (phy_info_lcnphy_t *) MALLOC(pi->sh->osh,
- sizeof(phy_info_lcnphy_t));
+ pi->u.pi_lcnphy = kzalloc(sizeof(phy_info_lcnphy_t), GFP_ATOMIC);
if (pi->u.pi_lcnphy == NULL) {
return false;
}
- bzero((char *)pi->u.pi_lcnphy, sizeof(phy_info_lcnphy_t));
pi_lcn = pi->u.pi_lcnphy;
diff --git a/drivers/staging/brcm80211/phy/wlc_phy_n.c b/drivers/staging/brcm80211/phy/wlc_phy_n.c
index fe449430d54d..27bb3499cc87 100644
--- a/drivers/staging/brcm80211/phy/wlc_phy_n.c
+++ b/drivers/staging/brcm80211/phy/wlc_phy_n.c
@@ -22360,7 +22360,7 @@ wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
tbl_len = (phy_bw << 1);
}
- tone_buf = (cs32 *) MALLOC(pi->sh->osh, sizeof(cs32) * tbl_len);
+ tone_buf = kmalloc(sizeof(cs32) * tbl_len, GFP_ATOMIC);
if (tone_buf == NULL) {
return 0;
}
@@ -22414,7 +22414,7 @@ wlc_phy_loadsampletable_nphy(phy_info_t *pi, cs32 *tone_buf,
u16 t;
u32 *data_buf = NULL;
- data_buf = (u32 *) MALLOC(pi->sh->osh, sizeof(u32) * num_samps);
+ data_buf = kmalloc(sizeof(u32) * num_samps, GFP_ATOMIC);
if (data_buf == NULL) {
return;
}
@@ -26727,7 +26727,7 @@ wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32 start,
ASSERT(end > start);
ASSERT(end < NPHY_PAPD_EPS_TBL_SIZE);
- buf = MALLOC(pi->sh->osh, 2 * sizeof(u32) * NPHY_PAPD_EPS_TBL_SIZE);
+ buf = kmalloc(2 * sizeof(u32) * NPHY_PAPD_EPS_TBL_SIZE, GFP_ATOMIC);
if (NULL == buf) {
return;
}