Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-drm-fsl-dcu.git] / net / irda / irda_device.c
index e3debbdb67f5a0272db139cda75eef326e0db71b..e717801b38f9c76b345df4ca5a08330e6f392f1b 100644 (file)
@@ -29,7 +29,6 @@
  *
  ********************************************************************/
 
-#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/proc_fs.h>
 #include <linux/skbuff.h>
@@ -342,11 +341,11 @@ static void irda_task_timer_expired(void *data)
  */
 static void irda_device_setup(struct net_device *dev)
 {
-        dev->hard_header_len = 0;
-        dev->addr_len        = LAP_ALEN;
+       dev->hard_header_len = 0;
+       dev->addr_len        = LAP_ALEN;
 
-        dev->type            = ARPHRD_IRDA;
-        dev->tx_queue_len    = 8; /* Window size + 1 s-frame */
+       dev->type            = ARPHRD_IRDA;
+       dev->tx_queue_len    = 8; /* Window size + 1 s-frame */
 
        memset(dev->broadcast, 0xff, LAP_ALEN);
 
@@ -355,7 +354,7 @@ static void irda_device_setup(struct net_device *dev)
 }
 
 /*
- * Funciton  alloc_irdadev 
+ * Funciton  alloc_irdadev
  *     Allocates and sets up an IRDA device in a manner similar to
  *     alloc_etherdev.
  */
@@ -387,9 +386,9 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
        /* Try to load the module needed */
        if (!reg && capable(CAP_SYS_MODULE)) {
                spin_unlock(&dongles->hb_spinlock);
-       
+
                request_module("irda-dongle-%d", type);
-               
+
                spin_lock(&dongles->hb_spinlock);
                reg = hashbin_find(dongles, type, NULL);
        }
@@ -402,12 +401,10 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
        }
 
        /* Allocate dongle info for this instance */
-       dongle = kmalloc(sizeof(dongle_t), GFP_KERNEL);
+       dongle = kzalloc(sizeof(dongle_t), GFP_KERNEL);
        if (!dongle)
                goto out;
 
-       memset(dongle, 0, sizeof(dongle_t));
-
        /* Bind the registration info to this particular instance */
        dongle->issue = reg;
        dongle->dev = dev;
@@ -441,15 +438,15 @@ int irda_device_register_dongle(struct dongle_reg *new)
        spin_lock(&dongles->hb_spinlock);
        /* Check if this dongle has been registered before */
        if (hashbin_find(dongles, new->type, NULL)) {
-               IRDA_MESSAGE("%s: Dongle type %x already registered\n", 
+               IRDA_MESSAGE("%s: Dongle type %x already registered\n",
                             __FUNCTION__, new->type);
-        } else {
+       } else {
                /* Insert IrDA dongle into hashbin */
                hashbin_insert(dongles, (irda_queue_t *) new, new->type, NULL);
        }
        spin_unlock(&dongles->hb_spinlock);
 
-        return 0;
+       return 0;
 }
 EXPORT_SYMBOL(irda_device_register_dongle);
 
@@ -465,7 +462,7 @@ void irda_device_unregister_dongle(struct dongle_reg *dongle)
 
        spin_lock(&dongles->hb_spinlock);
        node = hashbin_remove(dongles, dongle->type, NULL);
-       if (!node) 
+       if (!node)
                IRDA_ERROR("%s: dongle not found!\n", __FUNCTION__);
        spin_unlock(&dongles->hb_spinlock);
 }