treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / scsi / fdomain_pci.c
blob3e05ce7b89e5d8c63a2e6ba64c05e5ae087c8c40
1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/module.h>
4 #include <linux/pci.h>
5 #include "fdomain.h"
7 static int fdomain_pci_probe(struct pci_dev *pdev,
8 const struct pci_device_id *d)
10 int err;
11 struct Scsi_Host *sh;
13 err = pci_enable_device(pdev);
14 if (err)
15 goto fail;
17 err = pci_request_regions(pdev, "fdomain_pci");
18 if (err)
19 goto disable_device;
21 err = -ENODEV;
22 if (pci_resource_len(pdev, 0) == 0)
23 goto release_region;
25 sh = fdomain_create(pci_resource_start(pdev, 0), pdev->irq, 7,
26 &pdev->dev);
27 if (!sh)
28 goto release_region;
30 pci_set_drvdata(pdev, sh);
31 return 0;
33 release_region:
34 pci_release_regions(pdev);
35 disable_device:
36 pci_disable_device(pdev);
37 fail:
38 return err;
41 static void fdomain_pci_remove(struct pci_dev *pdev)
43 struct Scsi_Host *sh = pci_get_drvdata(pdev);
45 fdomain_destroy(sh);
46 pci_release_regions(pdev);
47 pci_disable_device(pdev);
50 static struct pci_device_id fdomain_pci_table[] = {
51 { PCI_DEVICE(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70) },
54 MODULE_DEVICE_TABLE(pci, fdomain_pci_table);
56 static struct pci_driver fdomain_pci_driver = {
57 .name = "fdomain_pci",
58 .id_table = fdomain_pci_table,
59 .probe = fdomain_pci_probe,
60 .remove = fdomain_pci_remove,
61 .driver.pm = FDOMAIN_PM_OPS,
64 module_pci_driver(fdomain_pci_driver);
66 MODULE_AUTHOR("Ondrej Zary, Rickard E. Faith");
67 MODULE_DESCRIPTION("Future Domain TMC-3260 PCI SCSI driver");
68 MODULE_LICENSE("GPL");