Patchwork [3.6.0-,2/3] net/mdio-octeon: use module_platform_driver macro

login
register
mail settings
Submitter Srinivas KANDAGATLA
Date Oct. 10, 2012, 6:29 p.m.
Message ID <1349893751-6867-1-git-send-email-srinivas.kandagatla@st.com>
Download mbox | patch
Permalink /patch/190737/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Srinivas KANDAGATLA - Oct. 10, 2012, 6:29 p.m.
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>

This patch removes some code duplication by using
module_platform_driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
 drivers/net/phy/mdio-octeon.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
ddaney.cavm@gmail.com - Oct. 10, 2012, 6:46 p.m.
On 10/10/2012 11:29 AM, Srinivas KANDAGATLA wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
>
> This patch removes some code duplication by using
> module_platform_driver.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>

Acked-by: David Daney <david.daney@cavium.com>

I have the same thing locally, but you beat me to sending it in.


> ---
>   drivers/net/phy/mdio-octeon.c |   14 +-------------
>   1 files changed, 1 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
> index d4015aa..84f7c47 100644
> --- a/drivers/net/phy/mdio-octeon.c
> +++ b/drivers/net/phy/mdio-octeon.c
> @@ -196,19 +196,7 @@ void octeon_mdiobus_force_mod_depencency(void)
>   	/* Let ethernet drivers force us to be loaded.  */
>   }
>   EXPORT_SYMBOL(octeon_mdiobus_force_mod_depencency);
> -
> -static int __init octeon_mdiobus_mod_init(void)
> -{
> -	return platform_driver_register(&octeon_mdiobus_driver);
> -}
> -
> -static void __exit octeon_mdiobus_mod_exit(void)
> -{
> -	platform_driver_unregister(&octeon_mdiobus_driver);
> -}
> -
> -module_init(octeon_mdiobus_mod_init);
> -module_exit(octeon_mdiobus_mod_exit);
> +module_platform_driver(octeon_mdiobus_driver);
>
>   MODULE_DESCRIPTION(DRV_DESCRIPTION);
>   MODULE_VERSION(DRV_VERSION);
>

--
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

Patch

diff --git a/drivers/net/phy/mdio-octeon.c b/drivers/net/phy/mdio-octeon.c
index d4015aa..84f7c47 100644
--- a/drivers/net/phy/mdio-octeon.c
+++ b/drivers/net/phy/mdio-octeon.c
@@ -196,19 +196,7 @@  void octeon_mdiobus_force_mod_depencency(void)
 	/* Let ethernet drivers force us to be loaded.  */
 }
 EXPORT_SYMBOL(octeon_mdiobus_force_mod_depencency);
-
-static int __init octeon_mdiobus_mod_init(void)
-{
-	return platform_driver_register(&octeon_mdiobus_driver);
-}
-
-static void __exit octeon_mdiobus_mod_exit(void)
-{
-	platform_driver_unregister(&octeon_mdiobus_driver);
-}
-
-module_init(octeon_mdiobus_mod_init);
-module_exit(octeon_mdiobus_mod_exit);
+module_platform_driver(octeon_mdiobus_driver);
 
 MODULE_DESCRIPTION(DRV_DESCRIPTION);
 MODULE_VERSION(DRV_VERSION);