Commit 13b79a0d authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Greg Kroah-Hartman

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: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 677c5072
...@@ -422,7 +422,6 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg) ...@@ -422,7 +422,6 @@ static int lynxfb_suspend(struct pci_dev *pdev, pm_message_t mesg)
return ret; return ret;
} }
pci_disable_device(pdev);
ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg)); ret = pci_set_power_state(pdev, pci_choose_state(pdev, mesg));
if (ret) { if (ret) {
pr_err("error:%d occurred in pci_set_power_state\n", 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, ...@@ -1053,14 +1052,14 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
int err; int err;
/* enable device */ /* enable device */
err = pci_enable_device(pdev); err = pcim_enable_device(pdev);
if (err) if (err)
return err; return err;
err = -ENOMEM; err = -ENOMEM;
sm750_dev = devm_kzalloc(&pdev->dev, sizeof(*sm750_dev), GFP_KERNEL); sm750_dev = devm_kzalloc(&pdev->dev, sizeof(*sm750_dev), GFP_KERNEL);
if (!sm750_dev) if (!sm750_dev)
goto disable_pci; return err;
sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1] = NULL; sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1] = NULL;
sm750_dev->devid = pdev->device; sm750_dev->devid = pdev->device;
...@@ -1115,8 +1114,6 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, ...@@ -1115,8 +1114,6 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
release_fb: release_fb:
sm750fb_frambuffer_release(sm750_dev); sm750fb_frambuffer_release(sm750_dev);
disable_pci:
pci_disable_device(pdev);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment