diff mbox

[-next] mmc: cavium: Use module_pci_driver to simplify the code

Message ID 20170425031409.9822-1-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun April 25, 2017, 3:14 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

Use the module_pci_driver() macro to make the code simpler
by eliminating module_init and module_exit calls.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/mmc/host/cavium-thunderx.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)




--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jan Glauber April 25, 2017, 6:02 a.m. UTC | #1
On Tue, Apr 25, 2017 at 03:14:09AM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> Use the module_pci_driver() macro to make the code simpler
> by eliminating module_init and module_exit calls.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/mmc/host/cavium-thunderx.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
> index 65244e8..fe3d772 100644
> --- a/drivers/mmc/host/cavium-thunderx.c
> +++ b/drivers/mmc/host/cavium-thunderx.c
> @@ -179,18 +179,7 @@ static struct pci_driver thunder_mmc_driver = {
>  	.remove = thunder_mmc_remove,
>  };
>  
> -static int __init thunder_mmc_init_module(void)
> -{
> -	return pci_register_driver(&thunder_mmc_driver);
> -}
> -
> -static void __exit thunder_mmc_exit_module(void)
> -{
> -	pci_unregister_driver(&thunder_mmc_driver);
> -}
> -
> -module_init(thunder_mmc_init_module);
> -module_exit(thunder_mmc_exit_module);
> +module_pci_driver(thunder_mmc_driver);
>  
>  MODULE_AUTHOR("Cavium Inc.");
>  MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");
> 
>

Acked-by: Jan Glauber <jglauber@cavium.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson April 25, 2017, 7:57 a.m. UTC | #2
On 25 April 2017 at 05:14, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> Use the module_pci_driver() macro to make the code simpler
> by eliminating module_init and module_exit calls.
>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/cavium-thunderx.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
> index 65244e8..fe3d772 100644
> --- a/drivers/mmc/host/cavium-thunderx.c
> +++ b/drivers/mmc/host/cavium-thunderx.c
> @@ -179,18 +179,7 @@ static struct pci_driver thunder_mmc_driver = {
>         .remove = thunder_mmc_remove,
>  };
>
> -static int __init thunder_mmc_init_module(void)
> -{
> -       return pci_register_driver(&thunder_mmc_driver);
> -}
> -
> -static void __exit thunder_mmc_exit_module(void)
> -{
> -       pci_unregister_driver(&thunder_mmc_driver);
> -}
> -
> -module_init(thunder_mmc_init_module);
> -module_exit(thunder_mmc_exit_module);
> +module_pci_driver(thunder_mmc_driver);
>
>  MODULE_AUTHOR("Cavium Inc.");
>  MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
index 65244e8..fe3d772 100644
--- a/drivers/mmc/host/cavium-thunderx.c
+++ b/drivers/mmc/host/cavium-thunderx.c
@@ -179,18 +179,7 @@  static struct pci_driver thunder_mmc_driver = {
 	.remove = thunder_mmc_remove,
 };
 
-static int __init thunder_mmc_init_module(void)
-{
-	return pci_register_driver(&thunder_mmc_driver);
-}
-
-static void __exit thunder_mmc_exit_module(void)
-{
-	pci_unregister_driver(&thunder_mmc_driver);
-}
-
-module_init(thunder_mmc_init_module);
-module_exit(thunder_mmc_exit_module);
+module_pci_driver(thunder_mmc_driver);
 
 MODULE_AUTHOR("Cavium Inc.");
 MODULE_DESCRIPTION("Cavium ThunderX eMMC Driver");