Skip to content

Commit

Permalink
carl9170: replace bitmap_zalloc with devm_bitmap_zalloc
Browse files Browse the repository at this point in the history
the mem_bitmap is kept around for the lifetime of the
driver device. This is a perfect candidate for devm.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/0a79221aa5477501c3def032e95ef8018973a514.1646250537.git.chunkeey@gmail.com
  • Loading branch information
Christian Lamparter authored and Kalle Valo committed Mar 10, 2022
1 parent 87ddb2f commit a8da65f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/net/wireless/ath/carl9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1943,11 +1943,7 @@ int carl9170_register(struct ar9170 *ar)
struct ath_regulatory *regulatory = &ar->common.regulatory;
int err = 0, i;

if (WARN_ON(ar->mem_bitmap))
return -EINVAL;

ar->mem_bitmap = bitmap_zalloc(ar->fw.mem_blocks, GFP_KERNEL);

ar->mem_bitmap = devm_bitmap_zalloc(&ar->udev->dev, ar->fw.mem_blocks, GFP_KERNEL);
if (!ar->mem_bitmap)
return -ENOMEM;

Expand Down Expand Up @@ -2050,9 +2046,6 @@ void carl9170_free(struct ar9170 *ar)
kfree_skb(ar->rx_failover);
ar->rx_failover = NULL;

bitmap_free(ar->mem_bitmap);
ar->mem_bitmap = NULL;

kfree(ar->survey);
ar->survey = NULL;

Expand Down

0 comments on commit a8da65f

Please sign in to comment.