/* Return codes 0 - successful other values - error  */
static int lpfc_enable_pci_dev(struct lpfc_hba *phba)
/* Return codes 0 - successful other values - error  */
static int lpfc_enable_pci_dev(struct lpfc_hba *phba)
{
	struct pci_dev *pdev;
	int bars;
	if (!phba->pcidev)
		goto out_error;
	else
		pdev = phba->pcidev;
	bars = pci_select_bars(pdev, IORESOURCE_MEM);
	if (pci_enable_device_mem(pdev))
		goto out_error;
	if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
		goto out_disable_device;
	pci_set_master(pdev);
	pci_try_set_mwi(pdev);
	pci_save_state(pdev);
	return 0;
out_disable_device:
	pci_disable_device(pdev);
out_error:
	return -ENODEV;
}