Skip to contentSkip to conversation

ath5k: add missing iounmap to AHB probe removal

PATCH Jonathan Bither 2 participants 3 messages Apr 24, 2012 Atheros ATH5K wireless driver

lore
Share & tools
lore
#0 lore raw

When our driver device is removed on the AHB bus, our IO memory is never unmapped.

drivers/net/wireless/ath/ath5k/ahb.c +3 -0
index 8c50d9d..eebf439 100644
@@ -197,12 +197,14 @@ static int ath_ahb_remove(struct platform_device *pdev)
 	struct ar231x_board_config *bcfg = pdev->dev.platform_data;
 	struct ieee80211_hw *hw = platform_get_drvdata(pdev);
 	struct ath5k_hw *ah;
+	void __iomem *mem;
 	u32 reg;
 
 	if (!hw)
 		return 0;
 
 	ah = hw->priv;
+	mem = ah->iobase;
 
 	if (bcfg->devid >= AR5K_SREV_AR2315_R6) {
 		/* Disable WMAC AHB arbitration */
@@ -222,6 +224,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
 	ath5k_deinit_ah(ah);
 	platform_set_drvdata(pdev, NULL);
 	ieee80211_free_hw(hw);
+	iounmap(mem);
 
 	return 0;
 }
#1 lore raw

Hi Jonathan,

Quoted 24 lines · Jonathan Bither

When our driver device is removed on the AHB bus, our IO memory is never unmapped.

drivers/net/wireless/ath/ath5k/ahb.c +2 -0
index 8c50d9d..eebf439 100644
@@ -197,12 +197,14 @@ static int ath_ahb_remove(struct platform_device *pdev)
  	struct ar231x_board_config *bcfg = pdev->dev.platform_data;
  	struct ieee80211_hw *hw = platform_get_drvdata(pdev);
  	struct ath5k_hw *ah;
+	void __iomem *mem;
  	u32 reg;
 
  	if (!hw)
  		return 0;
 
  	ah = hw->priv;
+	mem = ah->iobase;
 
  	if (bcfg->devid>= AR5K_SREV_AR2315_R6) {
  		/* Disable WMAC AHB arbitration */

drivers/net/wireless/ath/ath5k/ahb.c static int ath_ahb_remove(struct platform_device *pdev) · line 227

Quoted 4 lines
drivers/net/wireless/ath/ath5k/ahb.c +1 -0
@@ -222,6 +224,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
  	ath5k_deinit_ah(ah);
  	platform_set_drvdata(pdev, NULL);
  	ieee80211_free_hw(hw);
+	iounmap(mem);

You don't need this temporary variable, just use iounmap(ah->iobase) after ath5k_deinit_ah(ah) just like how it is done in the PCI case. --
Florian

#2 lore raw

Alright, thanks for the reviewal. I'll submit a V2

Quoted 35 lines · Florian Fainelli

Hi Jonathan,

Quoted 24 lines · Jonathan Bither

When our driver device is removed on the AHB bus, our IO memory is never unmapped.

drivers/net/wireless/ath/ath5k/ahb.c +2 -0
index 8c50d9d..eebf439 100644
@@ -197,12 +197,14 @@ static int ath_ahb_remove(struct platform_device *pdev)
      struct ar231x_board_config *bcfg = pdev->dev.platform_data;
      struct ieee80211_hw *hw = platform_get_drvdata(pdev);
      struct ath5k_hw *ah;
+    void __iomem *mem;
      u32 reg;
 
      if (!hw)
          return 0;
 
      ah = hw->priv;
+    mem = ah->iobase;
 
      if (bcfg->devid>= AR5K_SREV_AR2315_R6) {
          /* Disable WMAC AHB arbitration */

drivers/net/wireless/ath/ath5k/ahb.c static int ath_ahb_remove(struct platform_device *pdev) · line 227

Quoted 4 lines
drivers/net/wireless/ath/ath5k/ahb.c +1 -0
@@ -222,6 +224,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
      ath5k_deinit_ah(ah);
      platform_set_drvdata(pdev, NULL);
      ieee80211_free_hw(hw);
+    iounmap(mem);

You don't need this temporary variable, just use iounmap(ah->iobase) after ath5k_deinit_ah(ah) just like how it is done in the PCI case.

Signature · 1 line
Florian