diff options
-rw-r--r-- | arch/x86/pci/common.c | 4 | ||||
-rw-r--r-- | include/linux/pci.h | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 9ab8509f7b15..82d22fc601ae 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c | |||
@@ -551,14 +551,14 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
551 | if ((err = pci_enable_resources(dev, mask)) < 0) | 551 | if ((err = pci_enable_resources(dev, mask)) < 0) |
552 | return err; | 552 | return err; |
553 | 553 | ||
554 | if (!dev->msi_enabled) | 554 | if (!pci_dev_msi_enabled(dev)) |
555 | return pcibios_enable_irq(dev); | 555 | return pcibios_enable_irq(dev); |
556 | return 0; | 556 | return 0; |
557 | } | 557 | } |
558 | 558 | ||
559 | void pcibios_disable_device (struct pci_dev *dev) | 559 | void pcibios_disable_device (struct pci_dev *dev) |
560 | { | 560 | { |
561 | if (!dev->msi_enabled && pcibios_disable_irq) | 561 | if (!pci_dev_msi_enabled(dev) && pcibios_disable_irq) |
562 | pcibios_disable_irq(dev); | 562 | pcibios_disable_irq(dev); |
563 | } | 563 | } |
564 | 564 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 0f6d2bb1df9c..80f8b8b65fde 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -336,6 +336,15 @@ struct pci_bus { | |||
336 | #define pci_bus_b(n) list_entry(n, struct pci_bus, node) | 336 | #define pci_bus_b(n) list_entry(n, struct pci_bus, node) |
337 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) | 337 | #define to_pci_bus(n) container_of(n, struct pci_bus, dev) |
338 | 338 | ||
339 | #ifdef CONFIG_PCI_MSI | ||
340 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) | ||
341 | { | ||
342 | return pci_dev->msi_enabled || pci_dev->msix_enabled; | ||
343 | } | ||
344 | #else | ||
345 | static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev) { return false; } | ||
346 | #endif | ||
347 | |||
339 | /* | 348 | /* |
340 | * Error values that may be returned by PCI functions. | 349 | * Error values that may be returned by PCI functions. |
341 | */ | 350 | */ |