mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
genwqe: use pci_irq_allocate_vectors
Simply the interrupt setup by using the new PCI layer helpers. One odd thing about this driver is that it looks like it could request multiple MSI vectors, but it will then only ever use a single one. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com> Acked-by: Frank Haverkamp <haver@linux.vnet.ibm.com>= Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d4608a83f7
commit
d3f45647a4
2 changed files with 2 additions and 11 deletions
|
@ -41,7 +41,6 @@
|
||||||
#include "genwqe_driver.h"
|
#include "genwqe_driver.h"
|
||||||
|
|
||||||
#define GENWQE_MSI_IRQS 4 /* Just one supported, no MSIx */
|
#define GENWQE_MSI_IRQS 4 /* Just one supported, no MSIx */
|
||||||
#define GENWQE_FLAG_MSI_ENABLED (1 << 0)
|
|
||||||
|
|
||||||
#define GENWQE_MAX_VFS 15 /* maximum 15 VFs are possible */
|
#define GENWQE_MAX_VFS 15 /* maximum 15 VFs are possible */
|
||||||
#define GENWQE_MAX_FUNCS 16 /* 1 PF and 15 VFs */
|
#define GENWQE_MAX_FUNCS 16 /* 1 PF and 15 VFs */
|
||||||
|
|
|
@ -740,13 +740,10 @@ int genwqe_read_softreset(struct genwqe_dev *cd)
|
||||||
int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count)
|
int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
struct pci_dev *pci_dev = cd->pci_dev;
|
|
||||||
|
|
||||||
rc = pci_enable_msi_range(pci_dev, 1, count);
|
rc = pci_alloc_irq_vectors(cd->pci_dev, 1, count, PCI_IRQ_MSI);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
cd->flags |= GENWQE_FLAG_MSI_ENABLED;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -756,12 +753,7 @@ int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count)
|
||||||
*/
|
*/
|
||||||
void genwqe_reset_interrupt_capability(struct genwqe_dev *cd)
|
void genwqe_reset_interrupt_capability(struct genwqe_dev *cd)
|
||||||
{
|
{
|
||||||
struct pci_dev *pci_dev = cd->pci_dev;
|
pci_free_irq_vectors(cd->pci_dev);
|
||||||
|
|
||||||
if (cd->flags & GENWQE_FLAG_MSI_ENABLED) {
|
|
||||||
pci_disable_msi(pci_dev);
|
|
||||||
cd->flags &= ~GENWQE_FLAG_MSI_ENABLED;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue