fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / net / wireless / hostap / hostap_pci.c
index 2e85bdc..c4f6020 100644 (file)
@@ -4,7 +4,6 @@
  * driver patches from Reyk Floeter <reyk@vantronix.net> and
  * Andy Warner <andyw@pobox.com> */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/if.h>
@@ -301,13 +300,12 @@ static int prism2_pci_probe(struct pci_dev *pdev,
        struct hostap_interface *iface;
        struct hostap_pci_priv *hw_priv;
 
-       hw_priv = kmalloc(sizeof(*hw_priv), GFP_KERNEL);
+       hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL);
        if (hw_priv == NULL)
                return -ENOMEM;
-       memset(hw_priv, 0, sizeof(*hw_priv));
 
        if (pci_enable_device(pdev))
-               return -EIO;
+               goto err_out_free;
 
        phymem = pci_resource_start(pdev, 0);
 
@@ -338,7 +336,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
 
        pci_set_drvdata(pdev, dev);
 
-       if (request_irq(dev->irq, prism2_interrupt, SA_SHIRQ, dev->name,
+       if (request_irq(dev->irq, prism2_interrupt, IRQF_SHARED, dev->name,
                        dev)) {
                printk(KERN_WARNING "%s: request_irq failed\n", dev->name);
                goto fail;
@@ -368,6 +366,8 @@ static int prism2_pci_probe(struct pci_dev *pdev,
  err_out_disable:
        pci_disable_device(pdev);
        prism2_free_local_data(dev);
+
+ err_out_free:
        kfree(hw_priv);
 
        return -ENODEV;
@@ -424,8 +424,14 @@ static int prism2_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 static int prism2_pci_resume(struct pci_dev *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);
        prism2_hw_config(dev, 0);
        if (netif_running(dev)) {