Commit 50773696 authored by Ajay Singh's avatar Ajay Singh Committed by Kalle Valo

wilc1000: use wilc handler as cookie in request_threaded_irq()

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().
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210225042302.17048-1-ajay.kathat@microchip.com
parent e21b6e5a
...@@ -24,12 +24,10 @@ ...@@ -24,12 +24,10 @@
static irqreturn_t isr_uh_routine(int irq, void *user_data) static irqreturn_t isr_uh_routine(int irq, void *user_data)
{ {
struct net_device *dev = user_data; struct wilc *wilc = user_data;
struct wilc_vif *vif = netdev_priv(dev);
struct wilc *wilc = vif->wilc;
if (wilc->close) { if (wilc->close) {
netdev_err(dev, "Can't handle UH interrupt\n"); pr_err("Can't handle UH interrupt");
return IRQ_HANDLED; return IRQ_HANDLED;
} }
return IRQ_WAKE_THREAD; return IRQ_WAKE_THREAD;
...@@ -37,12 +35,10 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data) ...@@ -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) static irqreturn_t isr_bh_routine(int irq, void *userdata)
{ {
struct net_device *dev = userdata; struct wilc *wilc = userdata;
struct wilc_vif *vif = netdev_priv(userdata);
struct wilc *wilc = vif->wilc;
if (wilc->close) { if (wilc->close) {
netdev_err(dev, "Can't handle BH interrupt\n"); pr_err("Can't handle BH interrupt\n");
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -60,7 +56,7 @@ static int init_irq(struct net_device *dev) ...@@ -60,7 +56,7 @@ static int init_irq(struct net_device *dev)
ret = request_threaded_irq(wl->dev_irq_num, isr_uh_routine, ret = request_threaded_irq(wl->dev_irq_num, isr_uh_routine,
isr_bh_routine, isr_bh_routine,
IRQF_TRIGGER_FALLING | IRQF_ONESHOT, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
"WILC_IRQ", dev); "WILC_IRQ", wl);
if (ret) { if (ret) {
netdev_err(dev, "Failed to request IRQ [%d]\n", ret); netdev_err(dev, "Failed to request IRQ [%d]\n", ret);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment