diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-11-29 17:27:17 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-30 14:00:37 -0500 |
commit | 244a77e9d708d5a23eed21a4fb62a62acc9c69a6 (patch) | |
tree | f08e9604afc321169854eddbdc927cda40070f61 | |
parent | 88823492736a43f04d2ee114e0ec2b7725d3be35 (diff) |
rtlwifi: use SIMPLE_DEV_PM_OPS
rtlwifi only provides pm callbacks for functions covered by pm sleep
and they are also just called if CONFIG_PM_SLEEP is set.
Only add functions rtl_pci_suspend and rtl_pci_resume if
CONFIG_PM_SLEEP is set and use SIMPLE_DEV_PM_OPS instead of
manually filling struct dev_pm_ops.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192se/sw.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | 9 |
6 files changed, 8 insertions, 32 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index f38e30a947bc..086140cba026 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1982,6 +1982,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev) | |||
1982 | } | 1982 | } |
1983 | EXPORT_SYMBOL(rtl_pci_disconnect); | 1983 | EXPORT_SYMBOL(rtl_pci_disconnect); |
1984 | 1984 | ||
1985 | #ifdef CONFIG_PM_SLEEP | ||
1985 | /*************************************** | 1986 | /*************************************** |
1986 | kernel pci power state define: | 1987 | kernel pci power state define: |
1987 | PCI_D0 ((pci_power_t __force) 0) | 1988 | PCI_D0 ((pci_power_t __force) 0) |
@@ -2021,6 +2022,7 @@ int rtl_pci_resume(struct device *dev) | |||
2021 | return 0; | 2022 | return 0; |
2022 | } | 2023 | } |
2023 | EXPORT_SYMBOL(rtl_pci_resume); | 2024 | EXPORT_SYMBOL(rtl_pci_resume); |
2025 | #endif /* CONFIG_PM_SLEEP */ | ||
2024 | 2026 | ||
2025 | struct rtl_intf_ops rtl_pci_ops = { | 2027 | struct rtl_intf_ops rtl_pci_ops = { |
2026 | .read_efuse_byte = read_efuse_byte, | 2028 | .read_efuse_byte = read_efuse_byte, |
diff --git a/drivers/net/wireless/rtlwifi/pci.h b/drivers/net/wireless/rtlwifi/pci.h index f71b12aa8cb4..7ea50a32bafb 100644 --- a/drivers/net/wireless/rtlwifi/pci.h +++ b/drivers/net/wireless/rtlwifi/pci.h | |||
@@ -239,8 +239,10 @@ extern struct rtl_intf_ops rtl_pci_ops; | |||
239 | int __devinit rtl_pci_probe(struct pci_dev *pdev, | 239 | int __devinit rtl_pci_probe(struct pci_dev *pdev, |
240 | const struct pci_device_id *id); | 240 | const struct pci_device_id *id); |
241 | void rtl_pci_disconnect(struct pci_dev *pdev); | 241 | void rtl_pci_disconnect(struct pci_dev *pdev); |
242 | #ifdef CONFIG_PM_SLEEP | ||
242 | int rtl_pci_suspend(struct device *dev); | 243 | int rtl_pci_suspend(struct device *dev); |
243 | int rtl_pci_resume(struct device *dev); | 244 | int rtl_pci_resume(struct device *dev); |
245 | #endif /* CONFIG_PM_SLEEP */ | ||
244 | static inline u8 pci_read8_sync(struct rtl_priv *rtlpriv, u32 addr) | 246 | static inline u8 pci_read8_sync(struct rtl_priv *rtlpriv, u32 addr) |
245 | { | 247 | { |
246 | return readb((u8 __iomem *) rtlpriv->io.pci_mem_start + addr); | 248 | return readb((u8 __iomem *) rtlpriv->io.pci_mem_start + addr); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c index 60451eea4d82..49f663bd93ff 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | |||
@@ -372,14 +372,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); | |||
372 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); | 372 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); |
373 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); | 373 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); |
374 | 374 | ||
375 | static const struct dev_pm_ops rtlwifi_pm_ops = { | 375 | static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); |
376 | .suspend = rtl_pci_suspend, | ||
377 | .resume = rtl_pci_resume, | ||
378 | .freeze = rtl_pci_suspend, | ||
379 | .thaw = rtl_pci_resume, | ||
380 | .poweroff = rtl_pci_suspend, | ||
381 | .restore = rtl_pci_resume, | ||
382 | }; | ||
383 | 376 | ||
384 | static struct pci_driver rtl92ce_driver = { | 377 | static struct pci_driver rtl92ce_driver = { |
385 | .name = KBUILD_MODNAME, | 378 | .name = KBUILD_MODNAME, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c index 480862c07f92..e17f670d5c8e 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c | |||
@@ -378,14 +378,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); | |||
378 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); | 378 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); |
379 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); | 379 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); |
380 | 380 | ||
381 | static const struct dev_pm_ops rtlwifi_pm_ops = { | 381 | static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); |
382 | .suspend = rtl_pci_suspend, | ||
383 | .resume = rtl_pci_resume, | ||
384 | .freeze = rtl_pci_suspend, | ||
385 | .thaw = rtl_pci_resume, | ||
386 | .poweroff = rtl_pci_suspend, | ||
387 | .restore = rtl_pci_resume, | ||
388 | }; | ||
389 | 382 | ||
390 | static struct pci_driver rtl92de_driver = { | 383 | static struct pci_driver rtl92de_driver = { |
391 | .name = KBUILD_MODNAME, | 384 | .name = KBUILD_MODNAME, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c index c725133bf3a4..45c3443fccc8 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c | |||
@@ -429,14 +429,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); | |||
429 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); | 429 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); |
430 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); | 430 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); |
431 | 431 | ||
432 | static const struct dev_pm_ops rtlwifi_pm_ops = { | 432 | static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); |
433 | .suspend = rtl_pci_suspend, | ||
434 | .resume = rtl_pci_resume, | ||
435 | .freeze = rtl_pci_suspend, | ||
436 | .thaw = rtl_pci_resume, | ||
437 | .poweroff = rtl_pci_suspend, | ||
438 | .restore = rtl_pci_resume, | ||
439 | }; | ||
440 | 433 | ||
441 | static struct pci_driver rtl92se_driver = { | 434 | static struct pci_driver rtl92se_driver = { |
442 | .name = KBUILD_MODNAME, | 435 | .name = KBUILD_MODNAME, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c index 0afdc240f2fd..18b0bc51766b 100644 --- a/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8723ae/sw.c | |||
@@ -367,14 +367,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); | |||
367 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); | 367 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); |
368 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); | 368 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); |
369 | 369 | ||
370 | static const struct dev_pm_ops rtlwifi_pm_ops = { | 370 | static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); |
371 | .suspend = rtl_pci_suspend, | ||
372 | .resume = rtl_pci_resume, | ||
373 | .freeze = rtl_pci_suspend, | ||
374 | .thaw = rtl_pci_resume, | ||
375 | .poweroff = rtl_pci_suspend, | ||
376 | .restore = rtl_pci_resume, | ||
377 | }; | ||
378 | 371 | ||
379 | static struct pci_driver rtl8723ae_driver = { | 372 | static struct pci_driver rtl8723ae_driver = { |
380 | .name = KBUILD_MODNAME, | 373 | .name = KBUILD_MODNAME, |