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>
This commit is contained in:
Amitoj Kaur Chawla 2016-03-12 02:06:24 +05:30 committed by Greg Kroah-Hartman
parent 56c4a79958
commit 80f10bcc7f

View File

@ -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;
}