summaryrefslogtreecommitdiff
path: root/drivers/staging/sm750fb
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-02-28 21:22:00 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-11 22:09:09 -0800
commit13b79a0d88e350ec874e45fdbd08cb6f37fa4a48 (patch)
tree01911b0bcfe9910f48c933e10608c01e02d1cba3 /drivers/staging/sm750fb
parent677c50721181b0375a763941ce188997588b1ace (diff)
staging: sm750fb: Use pcim_enable_device()
Devm_ functions allocate memory that is released when a driver detaches. Replace pci_enable_device with the managed pcim_enable_device and remove corresponding pci_disable_device from probe and suspend functions of a pci_dev. Also, an unnecessary label has been removed by replacing it with a direct return statement. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sm750fb')
-rw-r--r--drivers/staging/sm750fb/sm750.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 8ec81bed8b54..aac74a7495f6 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -422,7 +422,6 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
return ret;
}
- pci_disable_device(pdev);
ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
if (ret) {
pr_err("error:%d occurred in pci_set_power_state\n", ret);
@@ -1053,14 +1052,14 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
int err;
/* enable device */
- err = pci_enable_device(pdev);
+ err = pcim_enable_device(pdev);
if (err)
return err;
err = -ENOMEM;
sm750_dev = devm_kzalloc(&pdev->dev, sizeof(*sm750_dev), GFP_KERNEL);
if (!sm750_dev)
- goto disable_pci;
+ return err;
sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1] = NULL;
sm750_dev->devid = pdev->device;
@@ -1115,8 +1114,6 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
release_fb:
sm750fb_frambuffer_release(sm750_dev);
-disable_pci:
- pci_disable_device(pdev);
return err;
}