aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/carl9170/main.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2022-03-02 20:51:37 +0100
committerKalle Valo <quic_kvalo@quicinc.com>2022-03-10 17:54:20 +0200
commita8da65f901fa45745123d665e80d1151d1bc7134 (patch)
treebb24d807140feb3a5f94195fea43ca4a9c435c61 /drivers/net/wireless/ath/carl9170/main.c
parentcarl9170: devres-ing input_allocate_device (diff)
downloadlinux-dev-a8da65f901fa45745123d665e80d1151d1bc7134.tar.xz
linux-dev-a8da65f901fa45745123d665e80d1151d1bc7134.zip
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: 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
Diffstat (limited to 'drivers/net/wireless/ath/carl9170/main.c')
-rw-r--r--drivers/net/wireless/ath/carl9170/main.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index e833052e9056..fae927ca4863 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -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;
@@ -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;