This patch just cleans up the ugly dgap_init_one function
Signed-off-by: Mark Hounschell <markh@compro.net>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Mark Hounschell <markh@compro.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (dgap_NumBoards >= MAXBOARDS)
return -EPERM;
- /* wake up and enable device */
rc = pci_enable_device(pdev);
+ if (rc)
+ return -EIO;
- if (rc < 0) {
- rc = -EIO;
- } else {
- rc = dgap_probe1(pdev, ent->driver_data);
- if (rc == 0) {
- dgap_NumBoards++;
- rc = dgap_firmware_load(pdev, ent->driver_data);
- }
- }
- return rc;
+ rc = dgap_probe1(pdev, ent->driver_data);
+ if (rc)
+ return rc;
+
+ dgap_NumBoards++;
+ return dgap_firmware_load(pdev, ent->driver_data);
}
static int dgap_probe1(struct pci_dev *pdev, int card_type)