@@ -839,7 +839,7 @@ static const struct net_device_ops ltq_eth_netdev_ops = {
.ndo_tx_timeout = ltq_etop_tx_timeout,
};
-static int __init
+static int __devinit
ltq_etop_probe(struct platform_device *pdev)
{
struct net_device *dev;
@@ -959,6 +959,7 @@ ltq_etop_remove(struct platform_device *pdev)
}
static struct platform_driver ltq_mii_driver = {
+ .probe = ltq_etop_probe,
.remove = __devexit_p(ltq_etop_remove),
.driver = {
.name = "ltq_etop",
@@ -966,24 +967,7 @@ static struct platform_driver ltq_mii_driver = {
},
};
-int __init
-init_ltq_etop(void)
-{
- int ret = platform_driver_probe(<q_mii_driver, ltq_etop_probe);
-
- if (ret)
- pr_err("ltq_etop: Error registering platfom driver!");
- return ret;
-}
-
-static void __exit
-exit_ltq_etop(void)
-{
- platform_driver_unregister(<q_mii_driver);
-}
-
-module_init(init_ltq_etop);
-module_exit(exit_ltq_etop);
+module_platform_driver(ltq_mii_driver);
MODULE_AUTHOR("John Crispin <blogic@openwrt.org>");
MODULE_DESCRIPTION("Lantiq SoC ETOP");
Reduce boilerplate code by converting driver to module_platform_driver. Signed-off-by: John Crispin <blogic@openwrt.org> Cc: netdev@vger.kernel.org --- drivers/net/ethernet/lantiq_etop.c | 22 +++------------------- 1 files changed, 3 insertions(+), 19 deletions(-)