* [PATCH] net: ath9k: use devm for gpio_request_one
@ 2024-07-31 21:00 Rosen Penev
2024-08-01 8:26 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 4+ messages in thread
From: Rosen Penev @ 2024-07-31 21:00 UTC (permalink / raw)
To: linux-kernel
No need to manually free the gpio now.
Remove if statement as it's redundant now. The gpio bit now gets cleared
whether set or not.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/wireless/ath/ath9k/hw.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 5982e0db45f9..dc18a813f1a0 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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,7 @@ 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);
- ah->caps.gpio_requested &= ~BIT(gpio);
- }
+ ah->caps.gpio_requested &= ~BIT(gpio);
}
EXPORT_SYMBOL(ath9k_hw_gpio_free);
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: ath9k: use devm for gpio_request_one
2024-07-31 21:00 [PATCH] net: ath9k: use devm for gpio_request_one Rosen Penev
@ 2024-08-01 8:26 ` Toke Høiland-Jørgensen
2024-08-01 8:50 ` Rosen Penev
0 siblings, 1 reply; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-08-01 8:26 UTC (permalink / raw)
To: Rosen Penev, linux-kernel
Rosen Penev <rosenp@gmail.com> writes:
> No need to manually free the gpio now.
>
> Remove if statement as it's redundant now. The gpio bit now gets cleared
> whether set or not.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
So presumably these will conflict with this patch?
https://patchwork.kernel.org/project/linux-wireless/patch/3b46f6c7-4372-4cc9-9a7c-2c1c06d29324@gmail.com/
-Toke
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: ath9k: use devm for gpio_request_one
2024-08-01 8:26 ` Toke Høiland-Jørgensen
@ 2024-08-01 8:50 ` Rosen Penev
2024-08-02 10:00 ` Toke Høiland-Jørgensen
0 siblings, 1 reply; 4+ messages in thread
From: Rosen Penev @ 2024-08-01 8:50 UTC (permalink / raw)
To: Toke Høiland-Jørgensen; +Cc: linux-kernel
On Thu, Aug 1, 2024 at 1:26 AM Toke Høiland-Jørgensen <toke@kernel.org> wrote:
>
> Rosen Penev <rosenp@gmail.com> writes:
>
> > No need to manually free the gpio now.
> >
> > Remove if statement as it's redundant now. The gpio bit now gets cleared
> > whether set or not.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
>
> So presumably these will conflict with this patch?
>
> https://patchwork.kernel.org/project/linux-wireless/patch/3b46f6c7-4372-4cc9-9a7c-2c1c06d29324@gmail.com/
This does not look related.
>
> -Toke
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: ath9k: use devm for gpio_request_one
2024-08-01 8:50 ` Rosen Penev
@ 2024-08-02 10:00 ` Toke Høiland-Jørgensen
0 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-08-02 10:00 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-kernel
Rosen Penev <rosenp@gmail.com> writes:
> On Thu, Aug 1, 2024 at 1:26 AM Toke Høiland-Jørgensen <toke@kernel.org> wrote:
>>
>> Rosen Penev <rosenp@gmail.com> writes:
>>
>> > No need to manually free the gpio now.
>> >
>> > Remove if statement as it's redundant now. The gpio bit now gets cleared
>> > whether set or not.
>> >
>> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
>>
>> So presumably these will conflict with this patch?
>>
>> https://patchwork.kernel.org/project/linux-wireless/patch/3b46f6c7-4372-4cc9-9a7c-2c1c06d29324@gmail.com/
> This does not look related.
Ah, no, you're right; was confusing the PCI-internal device managed
thing with the generic one :)
-Toke
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-02 10:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 21:00 [PATCH] net: ath9k: use devm for gpio_request_one Rosen Penev
2024-08-01 8:26 ` Toke Høiland-Jørgensen
2024-08-01 8:50 ` Rosen Penev
2024-08-02 10:00 ` Toke Høiland-Jørgensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox