drivers/net: Remove alloc_etherdev error messages
[deliverable/linux.git] / drivers / net / ethernet / xilinx / xilinx_emaclite.c
index 8018d7d045b044bbd0bb5dfa403e53d47d1bf390..90e611a6f6c61fbeb94817dc3c8b062cae331fad 100644 (file)
@@ -662,7 +662,7 @@ static void xemaclite_rx_handler(struct net_device *dev)
  */
 static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)
 {
-       bool tx_complete = 0;
+       bool tx_complete = false;
        struct net_device *dev = dev_id;
        struct net_local *lp = netdev_priv(dev);
        void __iomem *base_addr = lp->base_addr;
@@ -683,7 +683,7 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)
                tx_status &= ~XEL_TSR_XMIT_ACTIVE_MASK;
                out_be32(base_addr + XEL_TSR_OFFSET, tx_status);
 
-               tx_complete = 1;
+               tx_complete = true;
        }
 
        /* Check if the Transmission for the second buffer is completed */
@@ -695,7 +695,7 @@ static irqreturn_t xemaclite_interrupt(int irq, void *dev_id)
                out_be32(base_addr + XEL_BUFFER_OFFSET + XEL_TSR_OFFSET,
                         tx_status);
 
-               tx_complete = 1;
+               tx_complete = true;
        }
 
        /* If there was a Tx interrupt, call the Tx Handler */
@@ -1129,17 +1129,15 @@ static int __devinit xemaclite_of_probe(struct platform_device *ofdev)
 
        /* Get IRQ for the device */
        rc = of_irq_to_resource(ofdev->dev.of_node, 0, &r_irq);
-       if (rc == NO_IRQ) {
+       if (!rc) {
                dev_err(dev, "no IRQ found\n");
                return rc;
        }
 
        /* Create an ethernet device instance */
        ndev = alloc_etherdev(sizeof(struct net_local));
-       if (!ndev) {
-               dev_err(dev, "Could not allocate network device\n");
+       if (!ndev)
                return -ENOMEM;
-       }
 
        dev_set_drvdata(dev, ndev);
        SET_NETDEV_DEV(ndev, &ofdev->dev);
@@ -1303,27 +1301,7 @@ static struct platform_driver xemaclite_of_driver = {
        .remove         = __devexit_p(xemaclite_of_remove),
 };
 
-/**
- * xgpiopss_init - Initial driver registration call
- *
- * Return:     0 upon success, or a negative error upon failure.
- */
-static int __init xemaclite_init(void)
-{
-       /* No kernel boot options used, we just need to register the driver */
-       return platform_driver_register(&xemaclite_of_driver);
-}
-
-/**
- * xemaclite_cleanup - Driver un-registration call
- */
-static void __exit xemaclite_cleanup(void)
-{
-       platform_driver_unregister(&xemaclite_of_driver);
-}
-
-module_init(xemaclite_init);
-module_exit(xemaclite_cleanup);
+module_platform_driver(xemaclite_of_driver);
 
 MODULE_AUTHOR("Xilinx, Inc.");
 MODULE_DESCRIPTION("Xilinx Ethernet MAC Lite driver");
This page took 0.026773 seconds and 5 git commands to generate.