Staging: Comedi: Lindent changes to comdi driver in staging tree
[safe/jmp/linux-2.6] / drivers / staging / comedi / kcomedilib / kcomedilib_main.c
index 928e935..6552ef6 100644 (file)
@@ -67,7 +67,7 @@ void *comedi_open(const char *filename)
        if (!try_module_get(dev->driver->module))
                return NULL;
 
-       return (void *) dev;
+       return (void *)dev;
 }
 
 void *comedi_open_old(unsigned int minor)
@@ -86,12 +86,12 @@ void *comedi_open_old(unsigned int minor)
        if (dev == NULL || !dev->attached)
                return NULL;
 
-       return (void *) dev;
+       return (void *)dev;
 }
 
 int comedi_close(void *d)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
 
        module_put(dev->driver->module);
 
@@ -105,7 +105,7 @@ int comedi_loglevel(int newlevel)
 
 void comedi_perror(const char *message)
 {
-       rt_printk("%s: unknown error\n", message);
+       printk("%s: unknown error\n", message);
 }
 
 char *comedi_strerror(int err)
@@ -115,17 +115,17 @@ char *comedi_strerror(int err)
 
 int comedi_fileno(void *d)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
 
        /* return something random */
        return dev->minor;
 }
 
-int comedi_command(void *d, comedi_cmd *cmd)
+int comedi_command(void *d, struct comedi_cmd *cmd)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
-       comedi_async *async;
+       struct comedi_async *async;
        unsigned runflags;
 
        if (cmd->subdev >= dev->n_subdevices)
@@ -150,10 +150,6 @@ int comedi_command(void *d, comedi_cmd *cmd)
 
        runflags = SRF_RUNNING;
 
-#ifdef CONFIG_COMEDI_RT
-       if (comedi_switch_to_rt(dev) == 0)
-               runflags |= SRF_RT;
-#endif
        comedi_set_subdevice_runflags(s, ~0, runflags);
 
        comedi_reset_async_buf(async);
@@ -161,9 +157,9 @@ int comedi_command(void *d, comedi_cmd *cmd)
        return s->do_cmd(dev, s);
 }
 
-int comedi_command_test(void *d, comedi_cmd *cmd)
+int comedi_command_test(void *d, struct comedi_cmd *cmd)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
 
        if (cmd->subdev >= dev->n_subdevices)
@@ -183,9 +179,9 @@ int comedi_command_test(void *d, comedi_cmd *cmd)
  *     COMEDI_INSN
  *     perform an instruction
  */
-int comedi_do_insn(void *d, comedi_insn *insn)
+int comedi_do_insn(void *d, struct comedi_insn *insn)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
        int ret = 0;
 
@@ -208,7 +204,7 @@ int comedi_do_insn(void *d, comedi_insn *insn)
                                ret = -EINVAL;
                                break;
                        }
-                       comedi_udelay(insn->data[0]);
+                       udelay(insn->data[0]);
                        ret = 1;
                        break;
                case INSN_INTTRIG:
@@ -217,19 +213,19 @@ int comedi_do_insn(void *d, comedi_insn *insn)
                                break;
                        }
                        if (insn->subdev >= dev->n_subdevices) {
-                               rt_printk("%d not usable subdevice\n",
-                                       insn->subdev);
+                               printk("%d not usable subdevice\n",
+                                      insn->subdev);
                                ret = -EINVAL;
                                break;
                        }
                        s = dev->subdevices + insn->subdev;
                        if (!s->async) {
-                               rt_printk("no async\n");
+                               printk("no async\n");
                                ret = -EINVAL;
                                break;
                        }
                        if (!s->async->inttrig) {
-                               rt_printk("no inttrig\n");
+                               printk("no inttrig\n");
                                ret = -EAGAIN;
                                break;
                        }
@@ -249,7 +245,7 @@ int comedi_do_insn(void *d, comedi_insn *insn)
                s = dev->subdevices + insn->subdev;
 
                if (s->type == COMEDI_SUBD_UNUSED) {
-                       rt_printk("%d not useable subdevice\n", insn->subdev);
+                       printk("%d not useable subdevice\n", insn->subdev);
                        ret = -EIO;
                        goto error;
                }
@@ -258,7 +254,7 @@ int comedi_do_insn(void *d, comedi_insn *insn)
 
                ret = check_chanlist(s, 1, &insn->chanspec);
                if (ret < 0) {
-                       rt_printk("bad chanspec\n");
+                       printk("bad chanspec\n");
                        ret = -EINVAL;
                        goto error;
                }
@@ -295,12 +291,12 @@ int comedi_do_insn(void *d, comedi_insn *insn)
 #if 0
        /* XXX do we want this? -- abbotti #if'ed it out for now. */
        if (ret != insn->n) {
-               rt_printk("BUG: result of insn != insn.n\n");
+               printk("BUG: result of insn != insn.n\n");
                ret = -EINVAL;
                goto error;
        }
 #endif
-      error:
+error:
 
        return ret;
 }
@@ -326,7 +322,7 @@ int comedi_do_insn(void *d, comedi_insn *insn)
 */
 int comedi_lock(void *d, unsigned int subdevice)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
        unsigned long flags;
        int ret = 0;
@@ -336,7 +332,7 @@ int comedi_lock(void *d, unsigned int subdevice)
 
        s = dev->subdevices + subdevice;
 
-       comedi_spin_lock_irqsave(&s->spin_lock, flags);
+       spin_lock_irqsave(&s->spin_lock, flags);
 
        if (s->busy) {
                ret = -EBUSY;
@@ -348,7 +344,7 @@ int comedi_lock(void *d, unsigned int subdevice)
                }
        }
 
-       comedi_spin_unlock_irqrestore(&s->spin_lock, flags);
+       spin_unlock_irqrestore(&s->spin_lock, flags);
 
        return ret;
 }
@@ -369,10 +365,10 @@ int comedi_lock(void *d, unsigned int subdevice)
 */
 int comedi_unlock(void *d, unsigned int subdevice)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
        unsigned long flags;
-       comedi_async *async;
+       struct comedi_async *async;
        int ret;
 
        if (subdevice >= dev->n_subdevices)
@@ -382,7 +378,7 @@ int comedi_unlock(void *d, unsigned int subdevice)
 
        async = s->async;
 
-       comedi_spin_lock_irqsave(&s->spin_lock, flags);
+       spin_lock_irqsave(&s->spin_lock, flags);
 
        if (s->busy) {
                ret = -EBUSY;
@@ -400,7 +396,7 @@ int comedi_unlock(void *d, unsigned int subdevice)
                ret = 0;
        }
 
-       comedi_spin_unlock_irqrestore(&s->spin_lock, flags);
+       spin_unlock_irqrestore(&s->spin_lock, flags);
 
        return ret;
 }
@@ -421,7 +417,7 @@ int comedi_unlock(void *d, unsigned int subdevice)
 */
 int comedi_cancel(void *d, unsigned int subdevice)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
        int ret = 0;
 
@@ -449,11 +445,6 @@ int comedi_cancel(void *d, unsigned int subdevice)
        if (ret)
                return ret;
 
-#ifdef CONFIG_COMEDI_RT
-       if (comedi_get_subdevice_runflags(s) & SRF_RT)
-               comedi_switch_to_non_rt(dev);
-
-#endif
        comedi_set_subdevice_runflags(s, SRF_RUNNING | SRF_RT, 0);
        s->async->inttrig = NULL;
        s->busy = NULL;
@@ -465,11 +456,12 @@ int comedi_cancel(void *d, unsigned int subdevice)
    registration of callback functions
  */
 int comedi_register_callback(void *d, unsigned int subdevice,
-       unsigned int mask, int (*cb) (unsigned int, void *), void *arg)
+                            unsigned int mask, int (*cb) (unsigned int,
+                                                          void *), void *arg)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
-       comedi_async *async;
+       struct comedi_async *async;
 
        if (subdevice >= dev->n_subdevices)
                return -EINVAL;
@@ -503,9 +495,9 @@ int comedi_register_callback(void *d, unsigned int subdevice,
 
 int comedi_poll(void *d, unsigned int subdevice)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s = dev->subdevices;
-       comedi_async *async;
+       struct comedi_async *async;
 
        if (subdevice >= dev->n_subdevices)
                return -EINVAL;
@@ -530,7 +522,7 @@ int comedi_poll(void *d, unsigned int subdevice)
 /* WARNING: not portable */
 int comedi_map(void *d, unsigned int subdevice, void *ptr)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
 
        if (subdevice >= dev->n_subdevices)
@@ -552,7 +544,7 @@ int comedi_map(void *d, unsigned int subdevice, void *ptr)
 /* WARNING: not portable */
 int comedi_unmap(void *d, unsigned int subdevice)
 {
-       struct comedi_device *dev = (struct comedi_device *) d;
+       struct comedi_device *dev = (struct comedi_device *)d;
        struct comedi_subdevice *s;
 
        if (subdevice >= dev->n_subdevices)