net: ath9k: use devm for gpio_request_one
PATCH 1/1 net: ath9k: use devm for gpio_request_one
Simpler.
Signed-off-by Rosen Penev <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +2 -4
@@ -2732,7 +2732,7 @@ static void ath9k_hw_gpio_cfg_soc(struct ath_hw *ah, u32 gpio, bool out,if (ah->caps.gpio_requested &BIT (gpio))return ; - err =gpio_request_one (gpio, out ?GPIOF_OUT_INIT_LOW :GPIOF_IN , label); + err =devm_gpio_request_one (ah->dev, gpio, out ?GPIOF_OUT_INIT_LOW :GPIOF_IN , label);if (err) {ath_err (ath9k_hw_common (ah),"request GPIO%d failed:%d\n" , gpio, err);
@@ -2801,10 +2801,8 @@ void ath9k_hw_gpio_free(struct ath_hw *ah, u32 gpio)WARN_ON (gpio >= ah->caps.num_gpio_pins); -if (ah->caps.gpio_requested &BIT (gpio)) { -gpio_free (gpio); +if (ah->caps.gpio_requested &BIT (gpio)) ah->caps.gpio_requested &= ~BIT (gpio); - } }EXPORT_SYMBOL (ath9k_hw_gpio_free);
Signature · 1 line
2.45.2
Quoted 3 lines · Rosen Penev
Simpler.
Signed-off-by Rosen Penev <[email protected]>
The title prefix should be "wifi:". I can fix that, no need to resend because of this.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 3 lines · Rosen Penev
Simpler.
Signed-off-by Rosen Penev <[email protected]>
Quoted 6 lines · Rosen Penev
Using
devm_gpio_request_one()is simpler as then we don't need to callgpio_free().Signed-off-by Rosen Penev <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
8aabc03c7d22 wifi: ath9k: use devm for gpio_request_one()
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches