Commit a8da65f9 authored by Christian Lamparter's avatar Christian Lamparter Committed by Kalle Valo

carl9170: replace bitmap_zalloc with devm_bitmap_zalloc

the mem_bitmap is kept around for the lifetime of the
driver device. This is a perfect candidate for devm.
Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/0a79221aa5477501c3def032e95ef8018973a514.1646250537.git.chunkeey@gmail.com
parent 87ddb2fc
...@@ -1943,11 +1943,7 @@ int carl9170_register(struct ar9170 *ar) ...@@ -1943,11 +1943,7 @@ int carl9170_register(struct ar9170 *ar)
struct ath_regulatory *regulatory = &ar->common.regulatory; struct ath_regulatory *regulatory = &ar->common.regulatory;
int err = 0, i; int err = 0, i;
if (WARN_ON(ar->mem_bitmap)) ar->mem_bitmap = devm_bitmap_zalloc(&ar->udev->dev, ar->fw.mem_blocks, GFP_KERNEL);
return -EINVAL;
ar->mem_bitmap = bitmap_zalloc(ar->fw.mem_blocks, GFP_KERNEL);
if (!ar->mem_bitmap) if (!ar->mem_bitmap)
return -ENOMEM; return -ENOMEM;
...@@ -2050,9 +2046,6 @@ void carl9170_free(struct ar9170 *ar) ...@@ -2050,9 +2046,6 @@ void carl9170_free(struct ar9170 *ar)
kfree_skb(ar->rx_failover); kfree_skb(ar->rx_failover);
ar->rx_failover = NULL; ar->rx_failover = NULL;
bitmap_free(ar->mem_bitmap);
ar->mem_bitmap = NULL;
kfree(ar->survey); kfree(ar->survey);
ar->survey = NULL; ar->survey = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment