Skip to content

Commit bd12fc9

Browse files
claudiubezneacristibirsan
authored andcommitted
staging: wilc1000: check for dev_irq_num
Check for dev_irq_number before trying to request the interrupt. request_threaded_irq() will fail otherwise. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
1 parent 7808c02 commit bd12fc9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/staging/wilc1000/netdev.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ static int init_irq(struct net_device *dev)
170170
struct wilc_vif *vif = netdev_priv(dev);
171171
struct wilc *wl = vif->wilc;
172172

173+
if (wl->dev_irq_num <= 0)
174+
return 0;
175+
173176
if (wl->io_type == WILC_HIF_SPI ||
174177
wl->io_type == WILC_HIF_SDIO_GPIO_IRQ) {
175178
if (request_threaded_irq(wl->dev_irq_num, isr_uh_routine,
@@ -182,8 +185,7 @@ static int init_irq(struct net_device *dev)
182185
return -EINVAL;
183186
}
184187
} else {
185-
if (wl->dev_irq_num &&
186-
request_irq(wl->dev_irq_num, host_wakeup_isr,
188+
if (request_irq(wl->dev_irq_num, host_wakeup_isr,
187189
IRQF_TRIGGER_FALLING |
188190
IRQF_NO_SUSPEND,
189191
"WILC_IRQ", wl) < 0) {

0 commit comments

Comments
 (0)