maltalinux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: malta

To: maltalinux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: malta
From: beth@linux-mips.org
Date: Fri, 16 Sep 2005 11:41:13 +0100
Reply-to: linux-mips@linux-mips.org
Sender: maltalinux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    malta
Changes by:     beth@ftp.linux-mips.org 05/09/16 11:41:12

Modified files:
        linux/arch/mips/kernel: Tag: MaltaRef_2_6 rtlx.c 

Log message:
        Tweaked the read and write poll handling.

diff -urN malta/linux/arch/mips/kernel/rtlx.c 
malta/linux/arch/mips/kernel/rtlx.c
--- malta/linux/arch/mips/kernel/rtlx.c 2005/09/02 17:02:54     1.1.1000.6
+++ malta/linux/arch/mips/kernel/rtlx.c 2005/09/16 10:41:12     1.1.1000.7
@@ -78,7 +78,8 @@
        int i;
 
        for (i = 0; i < RTLX_CHANNELS; i++) {
-                       wake_up_interruptible(&channel_wqs[i].lx_queue);
+                       wake_up(&channel_wqs[i].lx_queue);
+                       wake_up(&channel_wqs[i].rt_queue);
        }
 
        return r;
@@ -256,7 +257,12 @@
 
 unsigned int rtlx_read_poll(int index, int can_sleep)
 {
-       struct rtlx_channel *chan = &rtlx->channel[index];
+       struct rtlx_channel *chan; 
+       
+       if (rtlx == NULL)
+               return 0;
+
+       chan = &rtlx->channel[index];
        
        /* data available to read? */
        if (chan->lx_read == chan->lx_write) {
@@ -289,7 +295,7 @@
        }
        
        return (chan->lx_write + chan->buffer_size - chan->lx_read)
-              % chan->buffer_size;
+               % chan->buffer_size;
 }
 
 unsigned int rtlx_write_poll(int index)
@@ -398,11 +404,15 @@
        struct rtlx_channel *chan;
 
        minor = MINOR(file->f_dentry->d_inode->i_rdev);
-       chan = &rtlx->channel[minor];
 
        poll_wait(file, &channel_wqs[minor].rt_queue, wait);
        poll_wait(file, &channel_wqs[minor].lx_queue, wait);
 
+       if (rtlx == NULL)
+               return 0;
+
+       chan = &rtlx->channel[minor];
+
        /* data available to read? */
        if (rtlx_read_poll(minor, 0))
                mask |= POLLIN | POLLRDNORM;

<Prev in Thread] Current Thread [Next in Thread>