summaryrefslogtreecommitdiff
path: root/drivers/staging/rts5208
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-03-12 02:06:24 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-11 22:09:09 -0800
commit80f10bcc7f8c0ca4bc0ef61bdc001ec11d5991f9 (patch)
tree06bdf1b1157b22894631b40863cc3735741f6856 /drivers/staging/rts5208
parent56c4a79958ebe7fc476f03a31589863813e4dd89 (diff)
staging: rts5208: Replace pci_enable_device with pcim_enable_device
Devm_ functions allocate memory that is automatically freed when a driver detaches. Replace pci_enable_device with pcim_enable_device. Remove unnecessary pci_disable_device and pci_release_regions from probe and remove functions in rts5208 driver since pcim_enable_device contains a call to pcim_release which contains calls to both pci_disable_device and pci_release_regions. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208')
-rw-r--r--drivers/staging/rts5208/rtsx.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index 5ebaf8c97887..25d095a5ade7 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -656,9 +656,6 @@ static void rtsx_release_resources(struct rtsx_dev *dev)
if (dev->remap_addr)
iounmap(dev->remap_addr);
- pci_disable_device(dev->pci);
- pci_release_regions(dev->pci);
-
rtsx_release_chip(dev->chip);
kfree(dev->chip);
}
@@ -850,7 +847,7 @@ static int rtsx_probe(struct pci_dev *pci,
dev_dbg(&pci->dev, "Realtek PCI-E card reader detected\n");
- err = pci_enable_device(pci);
+ err = pcim_enable_device(pci);
if (err < 0) {
dev_err(&pci->dev, "PCI enable device failed!\n");
return err;
@@ -860,7 +857,6 @@ static int rtsx_probe(struct pci_dev *pci,
if (err < 0) {
dev_err(&pci->dev, "PCI request regions for %s failed!\n",
CR_DRIVER_NAME);
- pci_disable_device(pci);
return err;
}
@@ -871,8 +867,6 @@ static int rtsx_probe(struct pci_dev *pci,
host = scsi_host_alloc(&rtsx_host_template, sizeof(*dev));
if (!host) {
dev_err(&pci->dev, "Unable to allocate the scsi host\n");
- pci_release_regions(pci);
- pci_disable_device(pci);
return -ENOMEM;
}