.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /******************************************************************************* |
---|
2 | 3 | AudioScience HPI driver |
---|
3 | 4 | Common Linux HPI ioctl and module probe/remove functions |
---|
4 | 5 | |
---|
5 | 6 | Copyright (C) 1997-2014 AudioScience Inc. <support@audioscience.com> |
---|
6 | 7 | |
---|
7 | | - This program is free software; you can redistribute it and/or modify |
---|
8 | | - it under the terms of version 2 of the GNU General Public License as |
---|
9 | | - published by the Free Software Foundation; |
---|
10 | | - |
---|
11 | | - This program is distributed in the hope that it will be useful, |
---|
12 | | - but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | | - GNU General Public License for more details. |
---|
15 | 8 | |
---|
16 | 9 | *******************************************************************************/ |
---|
17 | 10 | #define SOURCEFILE_NAME "hpioctl.c" |
---|
.. | .. |
---|
336 | 329 | asihpi_irq_count, a->adapter->type, a->adapter->index); */ |
---|
337 | 330 | |
---|
338 | 331 | if (a->interrupt_callback) |
---|
339 | | - a->interrupt_callback(a); |
---|
| 332 | + return IRQ_WAKE_THREAD; |
---|
340 | 333 | |
---|
| 334 | + return IRQ_HANDLED; |
---|
| 335 | +} |
---|
| 336 | + |
---|
| 337 | +static irqreturn_t asihpi_isr_thread(int irq, void *dev_id) |
---|
| 338 | +{ |
---|
| 339 | + struct hpi_adapter *a = dev_id; |
---|
| 340 | + |
---|
| 341 | + if (a->interrupt_callback) |
---|
| 342 | + a->interrupt_callback(a); |
---|
341 | 343 | return IRQ_HANDLED; |
---|
342 | 344 | } |
---|
343 | 345 | |
---|
.. | .. |
---|
359 | 361 | pci_dev->device, pci_dev->subsystem_vendor, |
---|
360 | 362 | pci_dev->subsystem_device, pci_dev->devfn); |
---|
361 | 363 | |
---|
362 | | - if (pci_enable_device(pci_dev) < 0) { |
---|
| 364 | + if (pcim_enable_device(pci_dev) < 0) { |
---|
363 | 365 | dev_err(&pci_dev->dev, |
---|
364 | 366 | "pci_enable_device failed, disabling device\n"); |
---|
365 | 367 | return -EIO; |
---|
.. | .. |
---|
485 | 487 | } |
---|
486 | 488 | |
---|
487 | 489 | /* Note: request_irq calls asihpi_isr here */ |
---|
488 | | - if (request_irq(pci_dev->irq, asihpi_isr, IRQF_SHARED, |
---|
489 | | - "asihpi", &adapters[adapter_index])) { |
---|
| 490 | + if (request_threaded_irq(pci_dev->irq, asihpi_isr, |
---|
| 491 | + asihpi_isr_thread, IRQF_SHARED, |
---|
| 492 | + "asihpi", &adapters[adapter_index])) { |
---|
490 | 493 | dev_err(&pci_dev->dev, "request_irq(%d) failed\n", |
---|
491 | 494 | pci_dev->irq); |
---|
492 | 495 | goto err; |
---|