Commit b72490a5 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rtl8187se: cleanup r8180_pm.c

* remove unused rtl8180_{save_state,enable_wake}()
* remove commented out code
* beautify code
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 44a7dcbc
...@@ -15,16 +15,9 @@ ...@@ -15,16 +15,9 @@
#include "r8180_pm.h" #include "r8180_pm.h"
#include "r8180.h" #include "r8180.h"
int rtl8180_save_state (struct pci_dev *dev, u32 state) int rtl8180_suspend(struct pci_dev *pdev, pm_message_t 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)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
// struct r8180_priv *priv = ieee80211_priv(dev);
if (!netif_running(dev)) if (!netif_running(dev))
goto out_pci_suspend; goto out_pci_suspend;
...@@ -37,27 +30,28 @@ int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state) ...@@ -37,27 +30,28 @@ int rtl8180_suspend (struct pci_dev *pdev, pm_message_t state)
out_pci_suspend: out_pci_suspend:
pci_save_state(pdev); pci_save_state(pdev);
pci_disable_device(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; 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 net_device *dev = pci_get_drvdata(pdev);
// struct r8180_priv *priv = ieee80211_priv(dev);
int err; int err;
u32 val; u32 val;
pci_set_power_state(pdev, PCI_D0); pci_set_power_state(pdev, PCI_D0);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if(err) { if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n", printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
dev->name); dev->name);
return err; return err;
} }
pci_restore_state(pdev); pci_restore_state(pdev);
/* /*
* Suspend/Resume resets the PCI configuration space, so we have to * Suspend/Resume resets the PCI configuration space, so we have to
* re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries
...@@ -68,23 +62,13 @@ int rtl8180_resume (struct pci_dev *pdev) ...@@ -68,23 +62,13 @@ int rtl8180_resume (struct pci_dev *pdev)
if ((val & 0x0000ff00) != 0) if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
if(!netif_running(dev)) if (!netif_running(dev))
goto out; goto out;
if (dev->netdev_ops->ndo_open) if (dev->netdev_ops->ndo_open)
dev->netdev_ops->ndo_open(dev); dev->netdev_ops->ndo_open(dev);
netif_device_attach(dev); netif_device_attach(dev);
out: out:
return 0; 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);
}
...@@ -17,10 +17,8 @@ ...@@ -17,10 +17,8 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/pci.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_suspend (struct pci_dev *pdev, pm_message_t state);
int rtl8180_resume (struct pci_dev *pdev); int rtl8180_resume (struct pci_dev *pdev);
int rtl8180_enable_wake (struct pci_dev *dev, u32 state, int enable);
#endif //R8180_PM_H #endif //R8180_PM_H
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