#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
-#include <linux/gfp.h>
#include <linux/htirq.h>
/* Global ht irq lock.
int max_irq;
int pos;
int irq;
+ int node;
- pos = pci_find_capability(dev, PCI_CAP_ID_HT);
- while (pos) {
- u8 subtype;
- pci_read_config_byte(dev, pos + 3, &subtype);
- if (subtype == HT_CAPTYPE_IRQ)
- break;
- pos = pci_find_next_capability(dev, pos, PCI_CAP_ID_HT);
- }
+ pos = pci_find_ht_capability(dev, HT_CAPTYPE_IRQ);
if (!pos)
return -EINVAL;
cfg->msg.address_lo = 0xffffffff;
cfg->msg.address_hi = 0xffffffff;
- irq = create_irq();
- if (irq < 0) {
+ node = dev_to_node(&dev->dev);
+ irq = create_irq_nr(0, node);
+
+ if (irq <= 0) {
kfree(cfg);
return -EBUSY;
}
/**
* ht_destroy_irq - destroy an irq created with ht_create_irq
+ * @irq: irq to be destroyed
*
* This reverses ht_create_irq removing the specified irq from
* existence. The irq should be free before this happens.