]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/comedi/drivers/dt282x.c
staging: comedi: dt282x: dt282x_ai_insn_read() always fails
[karo-tx-linux.git] / drivers / staging / comedi / drivers / dt282x.c
index c1950e3b19a2b69f5f18adba431ec2b311897778..4a25382e9b861b1b4dce025c9a550a6958963378 100644 (file)
@@ -51,13 +51,16 @@ Notes:
     be fixed to check for this situation and return an error.
 */
 
+#include <linux/module.h>
 #include "../comedidev.h"
 
+#include <linux/delay.h>
 #include <linux/gfp.h>
-#include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+
 #include <asm/dma.h>
+
 #include "comedi_fc.h"
 
 #define DEBUG
@@ -264,8 +267,9 @@ struct dt282x_private {
                        }                                       \
                        udelay(5);                              \
                }                                               \
-               if (_i)                                         \
+               if (_i) {                                       \
                        b                                       \
+               }                                               \
        } while (0)
 
 static int prep_ai_dma(struct comedi_device *dev, int chan, int size);
@@ -1188,10 +1192,9 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 #endif
        }
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = dt282x_grab_dma(dev, it->options[opt_dma1],
                              it->options[opt_dma2]);