Commit 02e0e5e9 authored by John W. Linville's avatar John W. Linville Committed by Jeff Garzik

[PATCH] wireless: clean-up some "check return code" warnings

Clean-up some warnings from missing return code checks, mostly from
calling pci_enable_device during a PCI resume.
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5398d590
...@@ -425,8 +425,14 @@ static int prism2_pci_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -425,8 +425,14 @@ static int prism2_pci_suspend(struct pci_dev *pdev, pm_message_t state)
static int prism2_pci_resume(struct pci_dev *pdev) static int prism2_pci_resume(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
int err;
pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
dev->name);
return err;
}
pci_restore_state(pdev); pci_restore_state(pdev);
prism2_hw_config(dev, 0); prism2_hw_config(dev, 0);
if (netif_running(dev)) { if (netif_running(dev)) {
......
...@@ -6423,6 +6423,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev) ...@@ -6423,6 +6423,7 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
{ {
struct ipw2100_priv *priv = pci_get_drvdata(pci_dev); struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
struct net_device *dev = priv->net_dev; struct net_device *dev = priv->net_dev;
int err;
u32 val; u32 val;
if (IPW2100_PM_DISABLED) if (IPW2100_PM_DISABLED)
...@@ -6433,7 +6434,12 @@ static int ipw2100_resume(struct pci_dev *pci_dev) ...@@ -6433,7 +6434,12 @@ static int ipw2100_resume(struct pci_dev *pci_dev)
IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name); IPW_DEBUG_INFO("%s: Coming out of suspend...\n", dev->name);
pci_set_power_state(pci_dev, PCI_D0); pci_set_power_state(pci_dev, PCI_D0);
pci_enable_device(pci_dev); err = pci_enable_device(pci_dev);
if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
dev->name);
return err;
}
pci_restore_state(pci_dev); pci_restore_state(pci_dev);
/* /*
......
...@@ -11727,12 +11727,18 @@ static int ipw_pci_resume(struct pci_dev *pdev) ...@@ -11727,12 +11727,18 @@ static int ipw_pci_resume(struct pci_dev *pdev)
{ {
struct ipw_priv *priv = pci_get_drvdata(pdev); struct ipw_priv *priv = pci_get_drvdata(pdev);
struct net_device *dev = priv->net_dev; struct net_device *dev = priv->net_dev;
int err;
u32 val; u32 val;
printk(KERN_INFO "%s: Coming out of suspend...\n", dev->name); printk(KERN_INFO "%s: Coming out of suspend...\n", dev->name);
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
dev->name);
return err;
}
pci_restore_state(pdev); pci_restore_state(pdev);
/* /*
......
...@@ -60,7 +60,12 @@ static int orinoco_pci_resume(struct pci_dev *pdev) ...@@ -60,7 +60,12 @@ static int orinoco_pci_resume(struct pci_dev *pdev)
int err; int err;
pci_set_power_state(pdev, 0); pci_set_power_state(pdev, 0);
pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
dev->name);
return err;
}
pci_restore_state(pdev); pci_restore_state(pdev);
err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED, err = request_irq(pdev->irq, orinoco_interrupt, IRQF_SHARED,
......
...@@ -170,14 +170,15 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -170,14 +170,15 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
pci_set_master(pdev); pci_set_master(pdev);
/* enable MWI */ /* enable MWI */
pci_set_mwi(pdev); if (pci_set_mwi(pdev))
goto do_pci_release_regions;
/* setup the network device interface and its structure */ /* setup the network device interface and its structure */
if (!(ndev = islpci_setup(pdev))) { if (!(ndev = islpci_setup(pdev))) {
/* error configuring the driver as a network device */ /* error configuring the driver as a network device */
printk(KERN_ERR "%s: could not configure network device\n", printk(KERN_ERR "%s: could not configure network device\n",
DRV_NAME); DRV_NAME);
goto do_pci_release_regions; goto do_pci_clear_mwi;
} }
priv = netdev_priv(ndev); priv = netdev_priv(ndev);
...@@ -207,6 +208,8 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -207,6 +208,8 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id)
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
free_netdev(ndev); free_netdev(ndev);
priv = NULL; priv = NULL;
do_pci_clear_mwi:
pci_clear_mwi(pdev);
do_pci_release_regions: do_pci_release_regions:
pci_release_regions(pdev); pci_release_regions(pdev);
do_pci_disable_device: do_pci_disable_device:
...@@ -254,6 +257,8 @@ prism54_remove(struct pci_dev *pdev) ...@@ -254,6 +257,8 @@ prism54_remove(struct pci_dev *pdev)
free_netdev(ndev); free_netdev(ndev);
priv = NULL; priv = NULL;
pci_clear_mwi(pdev);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
...@@ -287,12 +292,19 @@ prism54_resume(struct pci_dev *pdev) ...@@ -287,12 +292,19 @@ prism54_resume(struct pci_dev *pdev)
{ {
struct net_device *ndev = pci_get_drvdata(pdev); struct net_device *ndev = pci_get_drvdata(pdev);
islpci_private *priv = ndev ? netdev_priv(ndev) : NULL; islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
BUG_ON(!priv); int err;
pci_enable_device(pdev); BUG_ON(!priv);
printk(KERN_NOTICE "%s: got resume request\n", ndev->name); printk(KERN_NOTICE "%s: got resume request\n", ndev->name);
err = pci_enable_device(pdev);
if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
ndev->name);
return err;
}
pci_restore_state(pdev); pci_restore_state(pdev);
/* alright let's go into the PREBOOT state */ /* alright let's go into the PREBOOT state */
......
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