2012-04-24 08:29:53

by Jonathan Bither

[permalink] [raw]
Subject: ath5k: add missing iounmap to AHB probe removal

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

Signed-off-by: Jonathan Bither <[email protected]>

diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
index 8c50d9d..eebf439 100644
--- a/drivers/net/wireless/ath/ath5k/ahb.c
+++ b/drivers/net/wireless/ath/ath5k/ahb.c
@@ -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;
}


2012-04-24 08:44:11

by Florian Fainelli

[permalink] [raw]
Subject: Re: ath5k: add missing iounmap to AHB probe removal

Hi Jonathan,

Le 04/24/12 10:29, Jonathan Bither a écrit :
> When our driver device is removed on the AHB bus, our IO memory is never unmapped.
>
> Signed-off-by: Jonathan Bither<[email protected]>
>
> diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
> index 8c50d9d..eebf439 100644
> --- a/drivers/net/wireless/ath/ath5k/ahb.c
> +++ b/drivers/net/wireless/ath/ath5k/ahb.c
> @@ -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);

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

2012-04-24 08:45:49

by Jonathan Bither

[permalink] [raw]
Subject: Re: ath5k: add missing iounmap to AHB probe removal

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

On 04/24/2012 04:42 AM, Florian Fainelli wrote:
> Hi Jonathan,
>
> Le 04/24/12 10:29, Jonathan Bither a écrit :
>> When our driver device is removed on the AHB bus, our IO memory is never unmapped.
>>
>> Signed-off-by: Jonathan Bither<[email protected]>
>>
>> diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
>> index 8c50d9d..eebf439 100644
>> --- a/drivers/net/wireless/ath/ath5k/ahb.c
>> +++ b/drivers/net/wireless/ath/ath5k/ahb.c
>> @@ -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);
>
> 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