All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: vt6655: remove suspend struct notifier_block.
@ 2015-06-16 22:43 Malcolm Priestley
  2015-06-16 22:43 ` [PATCH 2/2] staging: vt6655: use module_pci_driver helper Malcolm Priestley
  0 siblings, 1 reply; 2+ messages in thread
From: Malcolm Priestley @ 2015-06-16 22:43 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless, Malcolm Priestley

The only thing this does is vt6655_suspend which is already been called
upon suspend.

Remove function device_notify_reboot and structure device_notifier.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6655/device_main.c | 37 ------------------------------------
 1 file changed, 37 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 8dbde24..c393b73 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -148,15 +148,6 @@ static void device_free_info(struct vnt_private *pDevice);
 static bool device_get_pci_info(struct vnt_private *, struct pci_dev *pcid);
 static void device_print_info(struct vnt_private *pDevice);
 
-#ifdef CONFIG_PM
-static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
-static struct notifier_block device_notifier = {
-	.notifier_call = device_notify_reboot,
-	.next = NULL,
-	.priority = 0,
-};
-#endif
-
 static void device_init_rd0_ring(struct vnt_private *pDevice);
 static void device_init_rd1_ring(struct vnt_private *pDevice);
 static void device_init_td0_ring(struct vnt_private *pDevice);
@@ -1892,42 +1883,14 @@ static int __init vt6655_init_module(void)
 	int ret;
 
 	ret = pci_register_driver(&device_driver);
-#ifdef CONFIG_PM
-	if (ret >= 0)
-		register_reboot_notifier(&device_notifier);
-#endif
 
 	return ret;
 }
 
 static void __exit vt6655_cleanup_module(void)
 {
-#ifdef CONFIG_PM
-	unregister_reboot_notifier(&device_notifier);
-#endif
 	pci_unregister_driver(&device_driver);
 }
 
 module_init(vt6655_init_module);
 module_exit(vt6655_cleanup_module);
-
-#ifdef CONFIG_PM
-static int
-device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
-{
-	struct pci_dev *pdev = NULL;
-
-	switch (event) {
-	case SYS_DOWN:
-	case SYS_HALT:
-	case SYS_POWER_OFF:
-		for_each_pci_dev(pdev) {
-			if (pci_dev_driver(pdev) == &device_driver) {
-				if (pci_get_drvdata(pdev))
-					vt6655_suspend(pdev, PMSG_HIBERNATE);
-			}
-		}
-	}
-	return NOTIFY_DONE;
-}
-#endif
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] staging: vt6655: use module_pci_driver helper
  2015-06-16 22:43 [PATCH 1/2] staging: vt6655: remove suspend struct notifier_block Malcolm Priestley
@ 2015-06-16 22:43 ` Malcolm Priestley
  0 siblings, 0 replies; 2+ messages in thread
From: Malcolm Priestley @ 2015-06-16 22:43 UTC (permalink / raw)
  To: gregkh; +Cc: linux-wireless, Malcolm Priestley

Remove  vt6655_init_module and vt6655_cleanup_module and replace
module_pci_driver

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
---
 drivers/staging/vt6655/device_main.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index c393b73..0bfc939 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1878,19 +1878,4 @@ static struct pci_driver device_driver = {
 #endif
 };
 
-static int __init vt6655_init_module(void)
-{
-	int ret;
-
-	ret = pci_register_driver(&device_driver);
-
-	return ret;
-}
-
-static void __exit vt6655_cleanup_module(void)
-{
-	pci_unregister_driver(&device_driver);
-}
-
-module_init(vt6655_init_module);
-module_exit(vt6655_cleanup_module);
+module_pci_driver(device_driver);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-16 22:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16 22:43 [PATCH 1/2] staging: vt6655: remove suspend struct notifier_block Malcolm Priestley
2015-06-16 22:43 ` [PATCH 2/2] staging: vt6655: use module_pci_driver helper Malcolm Priestley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.