]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wan/cosa.c
ieee802154/at86rf230: Implement hardware address filter callback.
[karo-tx-linux.git] / drivers / net / wan / cosa.c
index 6aed238e573e65ffae7253dea218e7c6408d5503..84734a8050925054b69c981fc9be2ebb0341335c 100644 (file)
@@ -795,8 +795,8 @@ static ssize_t cosa_read(struct file *file,
        if (mutex_lock_interruptible(&chan->rlock))
                return -ERESTARTSYS;
        
-       if ((chan->rxdata = kmalloc(COSA_MTU, GFP_DMA|GFP_KERNEL)) == NULL) {
-               pr_info("%s: cosa_read() - OOM\n", cosa->name);
+       chan->rxdata = kmalloc(COSA_MTU, GFP_DMA|GFP_KERNEL);
+       if (chan->rxdata == NULL) {
                mutex_unlock(&chan->rlock);
                return -ENOMEM;
        }
@@ -874,9 +874,8 @@ static ssize_t cosa_write(struct file *file,
                count = COSA_MTU;
        
        /* Allocate the buffer */
-       if ((kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA)) == NULL) {
-               pr_notice("%s: cosa_write() OOM - dropping packet\n",
-                         cosa->name);
+       kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA);
+       if (kbuf == NULL) {
                up(&chan->wsem);
                return -ENOMEM;
        }
@@ -939,14 +938,14 @@ static int cosa_open(struct inode *inode, struct file *file)
        int ret = 0;
 
        mutex_lock(&cosa_chardev_mutex);
-       if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS)
+       if ((n=iminor(file_inode(file))>>CARD_MINOR_BITS)
                >= nr_cards) {
                ret = -ENODEV;
                goto out;
        }
        cosa = cosa_cards+n;
 
-       if ((n=iminor(file->f_path.dentry->d_inode)
+       if ((n=iminor(file_inode(file))
                & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) {
                ret = -ENODEV;
                goto out;