linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: wd719x: Use module_pci_driver
@ 2015-10-21 22:46 Muhammad Falak R Wani
  2015-10-22  7:23 ` Johannes Thumshirn
  0 siblings, 1 reply; 2+ messages in thread
From: Muhammad Falak R Wani @ 2015-10-21 22:46 UTC (permalink / raw)
  To: James E.J. Bottomley, linux-scsi, linux-kernel
  Cc: Ondrej Zary, Fida Mohammad, Muhammad Falak R Wani

Remove boilerplate code by using macro module_pci_driver.
For drivers whose __init and __exit paths only register and
unregister to the pci API, it is preferred to use this macro.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
 drivers/scsi/wd719x.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index 2a9da2e..6d3bce3 100644
--- a/drivers/scsi/wd719x.c
+++ b/drivers/scsi/wd719x.c
@@ -976,18 +976,7 @@ static struct pci_driver wd719x_pci_driver = {
 	.remove =	wd719x_pci_remove,
 };
 
-static int __init wd719x_init(void)
-{
-	return pci_register_driver(&wd719x_pci_driver);
-}
-
-static void __exit wd719x_exit(void)
-{
-	pci_unregister_driver(&wd719x_pci_driver);
-}
-
-module_init(wd719x_init);
-module_exit(wd719x_exit);
+module_pci_driver(wd719x_pci_driver);
 
 MODULE_DESCRIPTION("Western Digital WD7193/7197/7296 SCSI driver");
 MODULE_AUTHOR("Ondrej Zary, Aaron Dewell, Juergen Gaertner");
-- 
1.9.1


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

* Re: [PATCH] scsi: wd719x: Use module_pci_driver
  2015-10-21 22:46 [PATCH] scsi: wd719x: Use module_pci_driver Muhammad Falak R Wani
@ 2015-10-22  7:23 ` Johannes Thumshirn
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Thumshirn @ 2015-10-22  7:23 UTC (permalink / raw)
  To: Muhammad Falak R Wani, James E.J. Bottomley, linux-scsi, linux-kernel
  Cc: Ondrej Zary, Fida Mohammad

On Thu, 2015-10-22 at 04:16 +0530, Muhammad Falak R Wani wrote:
> Remove boilerplate code by using macro module_pci_driver.
> For drivers whose __init and __exit paths only register and
> unregister to the pci API, it is preferred to use this macro.
> 
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
> ---
>  drivers/scsi/wd719x.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
> index 2a9da2e..6d3bce3 100644
> --- a/drivers/scsi/wd719x.c
> +++ b/drivers/scsi/wd719x.c
> @@ -976,18 +976,7 @@ static struct pci_driver wd719x_pci_driver = {
>  	.remove =	wd719x_pci_remove,
>  };
>  
> -static int __init wd719x_init(void)
> -{
> -	return pci_register_driver(&wd719x_pci_driver);
> -}
> -
> -static void __exit wd719x_exit(void)
> -{
> -	pci_unregister_driver(&wd719x_pci_driver);
> -}
> -
> -module_init(wd719x_init);
> -module_exit(wd719x_exit);
> +module_pci_driver(wd719x_pci_driver);
>  
>  MODULE_DESCRIPTION("Western Digital WD7193/7197/7296 SCSI driver");
>  MODULE_AUTHOR("Ondrej Zary, Aaron Dewell, Juergen Gaertner");

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>


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

end of thread, other threads:[~2015-10-22  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-21 22:46 [PATCH] scsi: wd719x: Use module_pci_driver Muhammad Falak R Wani
2015-10-22  7:23 ` Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).