Skip to contentSkip to conversation

wilc1000: use wilc handler as cookie in request_threaded_irq()

PATCH In review [email protected] 2 participants 2 messages Feb 25, 2021 – Mar 15, 2021 Microchip WILC1000 wifi driver

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH v2 1/1 wilc1000: use wilc handler as cookie in request_threaded_irq()

From: Ajay Singh <[email protected]>

Use same cookie for request_threaded_irq() & free_irq() to properly free IRQ during module unload. free_irq() already uses *wilc* handler so the changes are required for request_threaded_irq().

---
 drivers/net/wireless/microchip/wilc1000/netdev.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/net/wireless/microchip/wilc1000/netdev.c +5 -9
index 1b205e7d97a8..9928e91c8ffa 100644
@@ -24,12 +24,10 @@
 
 static irqreturn_t isr_uh_routine(int irq, void *user_data)
 {
-	struct net_device *dev = user_data;
-	struct wilc_vif *vif = netdev_priv(dev);
-	struct wilc *wilc = vif->wilc;
+	struct wilc *wilc = user_data;
 
 	if (wilc->close) {
-		netdev_err(dev, "Can't handle UH interrupt\n");
+		pr_err("Can't handle UH interrupt");
 		return IRQ_HANDLED;
 	}
 	return IRQ_WAKE_THREAD;
@@ -37,12 +35,10 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
 
 static irqreturn_t isr_bh_routine(int irq, void *userdata)
 {
-	struct net_device *dev = userdata;
-	struct wilc_vif *vif = netdev_priv(userdata);
-	struct wilc *wilc = vif->wilc;
+	struct wilc *wilc = userdata;
 
 	if (wilc->close) {
-		netdev_err(dev, "Can't handle BH interrupt\n");
+		pr_err("Can't handle BH interrupt\n");
 		return IRQ_HANDLED;
 	}
 
@@ -60,7 +56,7 @@ static int init_irq(struct net_device *dev)
 	ret = request_threaded_irq(wl->dev_irq_num, isr_uh_routine,
 				   isr_bh_routine,
 				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
-				   "WILC_IRQ", dev);
+				   "WILC_IRQ", wl);
 	if (ret) {
 		netdev_err(dev, "Failed to request IRQ [%d]\n", ret);
 		return ret;
Signature · 1 line
2.24.0
#1 lore raw
Quoted 7 lines · <[email protected]> wrote:

From: Ajay Singh <[email protected]>

Use same cookie for request_threaded_irq() & free_irq() to properly free IRQ during module unload. free_irq() already uses *wilc* handler so the changes are required for request_threaded_irq().

Patch applied to wireless-drivers-next.git, thanks.

50773696301b wilc1000: use wilc handler as cookie in request_threaded_irq()

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches