]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skypopen: refined hrtimers support to OSS audio driver
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Sun, 19 Dec 2010 19:40:27 +0000 (13:40 -0600)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Sun, 19 Dec 2010 19:40:36 +0000 (13:40 -0600)
src/mod/endpoints/mod_skypopen/oss/main.c

index 2abc5b342af51f4611c88ff1d0d4491a0124a5e2..a96e38d68a62a61ffa37de5c802153eafacbdbb4 100644 (file)
@@ -250,6 +250,10 @@ static ssize_t skypopen_read(struct file *filp, char __user *buf, size_t count,
 {
        DEFINE_WAIT(wait);
        struct skypopen_dev *dev = filp->private_data;
+
+       if(unload)
+               return -1;
+
 #ifdef WANT_HRTIMER
 #if 1
        if(dev->timer_inq_started == 0){
@@ -278,6 +282,10 @@ static ssize_t skypopen_write(struct file *filp, const char __user *buf, size_t
 {
        DEFINE_WAIT(wait);
        struct skypopen_dev *dev = filp->private_data;
+
+       if(unload)
+               return -1;
+
 #ifdef WANT_HRTIMER
 #if 1
        if(dev->timer_outq_started == 0){
@@ -372,10 +380,14 @@ void skypopen_cleanup_module(void)
                ret= del_timer( &lptr->device.timer_outq );
                printk( "Stopped skypopen OSS driver write timer\n");
 #else// WANT_HRTIMER
-               ret = hrtimer_cancel( &lptr->device.timer_inq );
-               printk( "Stopped skypopen OSS driver read HRtimer\n");
-               ret = hrtimer_cancel( &lptr->device.timer_outq );
-               printk( "Stopped skypopen OSS driver write HRtimer\n");
+               if(lptr->device.timer_inq_started){
+                       ret = hrtimer_cancel( &lptr->device.timer_inq );
+                       printk( "Stopped skypopen OSS driver read HRtimer\n");
+               }
+               if(lptr->device.timer_outq_started){
+                       ret = hrtimer_cancel( &lptr->device.timer_outq );
+                       printk( "Stopped skypopen OSS driver write HRtimer\n");
+               }
 
 #endif// WANT_HRTIMER
                list_del(&lptr->list);