kfree(card);
}
+static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter)
+{
+ int ret;
+ struct pcie_service_card *card = adapter->card;
+ struct pci_dev *pdev = card->dev;
+
+ if (pci_enable_msi(pdev) != 0)
+ pci_disable_msi(pdev);
+ else
+ card->msi_enable = 1;
+
+ mwifiex_dbg(adapter, INFO, "msi_enable = %d\n", card->msi_enable);
+
+ ret = request_irq(pdev->irq, mwifiex_pcie_interrupt, IRQF_SHARED,
+ "MRVL_PCIE", pdev);
+ if (ret) {
+ pr_err("request_irq failed: ret=%d\n", ret);
+ adapter->card = NULL;
+ return -1;
+ }
+
+ return 0;
+}
+
/*
* This function registers the PCIE device.
*
*/
static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
{
- int ret;
struct pcie_service_card *card = adapter->card;
struct pci_dev *pdev = card->dev;
/* save adapter pointer in card */
card->adapter = adapter;
- ret = request_irq(pdev->irq, mwifiex_pcie_interrupt, IRQF_SHARED,
- "MRVL_PCIE", pdev);
- if (ret) {
- mwifiex_dbg(adapter, ERROR,
- "request_irq failed: ret=%d\n", ret);
- adapter->card = NULL;
+ if (mwifiex_pcie_request_irq(adapter))
return -1;
- }
adapter->dev = &pdev->dev;
adapter->tx_buf_size = card->pcie.tx_buf_size;