Commit 6a825241 authored by Mark Hounschell's avatar Mark Hounschell Committed by Greg Kroah-Hartman

staging: dgap: refactor ugly dgap_init_one function

This patch just cleans up the ugly dgap_init_one function
Signed-off-by: default avatarMark Hounschell <markh@compro.net>
Suggested-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Tested-by: default avatarMark Hounschell <markh@compro.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f34475f5
...@@ -575,19 +575,16 @@ static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -575,19 +575,16 @@ static int dgap_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (dgap_NumBoards >= MAXBOARDS) if (dgap_NumBoards >= MAXBOARDS)
return -EPERM; return -EPERM;
/* wake up and enable device */
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc)
return -EIO;
if (rc < 0) { rc = dgap_probe1(pdev, ent->driver_data);
rc = -EIO; if (rc)
} else { return rc;
rc = dgap_probe1(pdev, ent->driver_data);
if (rc == 0) { dgap_NumBoards++;
dgap_NumBoards++; return dgap_firmware_load(pdev, ent->driver_data);
rc = dgap_firmware_load(pdev, ent->driver_data);
}
}
return rc;
} }
static int dgap_probe1(struct pci_dev *pdev, int card_type) static int dgap_probe1(struct pci_dev *pdev, int card_type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment