net: ftgmac100: Use module_platform_driver()
[linux-2.6-block.git] / drivers / net / ethernet / faraday / ftgmac100.c
index 7c361d1db94cbccdb937368044b30913d891ba7f..21b85fb7d05f68da25f7980b937e61b1c4d9de56 100644 (file)
@@ -780,12 +780,11 @@ static int ftgmac100_alloc_buffers(struct ftgmac100 *priv)
 
        priv->descs = dma_alloc_coherent(priv->dev,
                                         sizeof(struct ftgmac100_descs),
-                                        &priv->descs_dma_addr, GFP_KERNEL);
+                                        &priv->descs_dma_addr,
+                                        GFP_KERNEL | __GFP_ZERO);
        if (!priv->descs)
                return -ENOMEM;
 
-       memset(priv->descs, 0, sizeof(struct ftgmac100_descs));
-
        /* initialize RX ring */
        ftgmac100_rxdes_set_end_of_ring(&priv->descs->rxdes[RX_QUEUE_ENTRIES - 1]);
 
@@ -1350,22 +1349,7 @@ static struct platform_driver ftgmac100_driver = {
        },
 };
 
-/******************************************************************************
- * initialization / finalization
- *****************************************************************************/
-static int __init ftgmac100_init(void)
-{
-       pr_info("Loading version " DRV_VERSION " ...\n");
-       return platform_driver_register(&ftgmac100_driver);
-}
-
-static void __exit ftgmac100_exit(void)
-{
-       platform_driver_unregister(&ftgmac100_driver);
-}
-
-module_init(ftgmac100_init);
-module_exit(ftgmac100_exit);
+module_platform_driver(ftgmac100_driver);
 
 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
 MODULE_DESCRIPTION("FTGMAC100 driver");