hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/sound/pci/asihpi/hpioctl.c
....@@ -1,17 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*******************************************************************************
23 AudioScience HPI driver
34 Common Linux HPI ioctl and module probe/remove functions
45
56 Copyright (C) 1997-2014 AudioScience Inc. <support@audioscience.com>
67
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.
158
169 *******************************************************************************/
1710 #define SOURCEFILE_NAME "hpioctl.c"
....@@ -336,8 +329,17 @@
336329 asihpi_irq_count, a->adapter->type, a->adapter->index); */
337330
338331 if (a->interrupt_callback)
339
- a->interrupt_callback(a);
332
+ return IRQ_WAKE_THREAD;
340333
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);
341343 return IRQ_HANDLED;
342344 }
343345
....@@ -359,7 +361,7 @@
359361 pci_dev->device, pci_dev->subsystem_vendor,
360362 pci_dev->subsystem_device, pci_dev->devfn);
361363
362
- if (pci_enable_device(pci_dev) < 0) {
364
+ if (pcim_enable_device(pci_dev) < 0) {
363365 dev_err(&pci_dev->dev,
364366 "pci_enable_device failed, disabling device\n");
365367 return -EIO;
....@@ -485,8 +487,9 @@
485487 }
486488
487489 /* 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])) {
490493 dev_err(&pci_dev->dev, "request_irq(%d) failed\n",
491494 pci_dev->irq);
492495 goto err;