diff mbox

[3/3] net: macb: Use module_platform_driver_probe macro

Message ID 1362457882-12892-3-git-send-email-sachin.kamat@linaro.org
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Sachin Kamat March 5, 2013, 4:31 a.m. UTC
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/net/ethernet/cadence/macb.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

Comments

Nicolas Ferre March 5, 2013, 9:36 a.m. UTC | #1
> module_platform_driver_probe() eliminates the boilerplate and simplifies
> the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>  drivers/net/ethernet/cadence/macb.c |   13 +------------
>  1 files changed, 1 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
> index 7903943..3a5d680 100644
> --- a/drivers/net/ethernet/cadence/macb.c
> +++ b/drivers/net/ethernet/cadence/macb.c
> @@ -1737,18 +1737,7 @@ static struct platform_driver macb_driver = {
>         },
>  };
> 
> -static int __init macb_init(void)
> -{
> -       return platform_driver_probe(&macb_driver, macb_probe);
> -}
> -
> -static void __exit macb_exit(void)
> -{
> -       platform_driver_unregister(&macb_driver);
> -}
> -
> -module_init(macb_init);
> -module_exit(macb_exit);
> +module_platform_driver_probe(macb_driver, macb_probe);
> 
>  MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");
> --
> 1.7.4.1
> --
To unsubscribe from this list: send the line "unsubscribe netdev" 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/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 7903943..3a5d680 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1737,18 +1737,7 @@  static struct platform_driver macb_driver = {
 	},
 };
 
-static int __init macb_init(void)
-{
-	return platform_driver_probe(&macb_driver, macb_probe);
-}
-
-static void __exit macb_exit(void)
-{
-	platform_driver_unregister(&macb_driver);
-}
-
-module_init(macb_init);
-module_exit(macb_exit);
+module_platform_driver_probe(macb_driver, macb_probe);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");