Staging: rtl8187se: cleanup r8180_pm.c
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sun, 28 Jun 2009 14:20:04 +0000 (16:20 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:01:31 +0000 (12:01 -0700)
* remove unused rtl8180_{save_state,enable_wake}()
* remove commented out code
* beautify code

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8187se/r8180_pm.c
drivers/staging/rtl8187se/r8180_pm.h

index ddc70c86cdfbdcbe4f9c2c8645d7f3a6501ddb6d..56a5ff92db5f09b04b3ff733b333bc8185010622 100644 (file)
 #include "r8180_pm.h"
 #include "r8180.h"
 
-int rtl8180_save_state (struct pci_dev *dev, u32 state)
-{
-        printk(KERN_NOTICE "r8180 save state call (state %u).\n", state);
-       return(-EAGAIN);
-}
-
-int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state)
+int rtl8180_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
-//     struct r8180_priv *priv = ieee80211_priv(dev);
 
        if (!netif_running(dev))
                goto out_pci_suspend;
@@ -37,27 +30,28 @@ int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state)
 out_pci_suspend:
        pci_save_state(pdev);
        pci_disable_device(pdev);
-       pci_set_power_state(pdev,pci_choose_state(pdev,state));
+       pci_set_power_state(pdev, pci_choose_state(pdev, state));
        return 0;
 }
 
-int rtl8180_resume (struct pci_dev *pdev)
+int rtl8180_resume(struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
-//     struct r8180_priv *priv = ieee80211_priv(dev);
        int err;
        u32 val;
 
        pci_set_power_state(pdev, PCI_D0);
 
        err = pci_enable_device(pdev);
-       if(err) {
+       if (err) {
                printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
                                dev->name);
 
                return err;
        }
+
        pci_restore_state(pdev);
+
        /*
         * Suspend/Resume resets the PCI configuration space, so we have to
         * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries
@@ -68,23 +62,13 @@ int rtl8180_resume (struct pci_dev *pdev)
        if ((val & 0x0000ff00) != 0)
                pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
 
-       if(!netif_running(dev))
+       if (!netif_running(dev))
                goto out;
 
        if (dev->netdev_ops->ndo_open)
                dev->netdev_ops->ndo_open(dev);
+
        netif_device_attach(dev);
 out:
        return 0;
 }
-
-
-int rtl8180_enable_wake (struct pci_dev *dev, u32 state, int enable)
-{
-        printk(KERN_NOTICE "r8180 enable wake call (state %u, enable %d).\n",
-              state, enable);
-       return(-EAGAIN);
-}
-
-
-
index 37cf2ced9f08bc8ad03b43d88ee364980cec6182..48ab9cd1f81da2d335e58aec9d785dc8489a7c34 100644 (file)
 #include <linux/types.h>
 #include <linux/pci.h>
 
-int rtl8180_save_state (struct pci_dev *dev, u32 state);
 int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state);
 int rtl8180_resume (struct pci_dev *pdev);
-int rtl8180_enable_wake (struct pci_dev *dev, u32 state, int enable);
 
 #endif //R8180_PM_H