]> rtime.felk.cvut.cz Git - mf6xx.git/commitdiff
Minor changes in example drivers.
authorRostislav Lisovy <lisovy@gmail.com>
Sun, 24 Apr 2011 16:48:33 +0000 (18:48 +0200)
committerRostislav Lisovy <lisovy@gmail.com>
Sun, 24 Apr 2011 16:48:33 +0000 (18:48 +0200)
doc/diploma_thesis/kernel_module_example/hello.c
src/comedi/mf614_simple_driver/kernel/mf614.c

index ffb016c10c115c9c5c916205265c381bf303ad13..694cbe1ad03ee1e597096b5d62d259ed5184126e 100644 (file)
@@ -1,9 +1,24 @@
 #include <linux/init.h>
 #include <linux/module.h>
 
+struct foo_t {
+       int zomg;
+       int lol;
+       int bar;
+};
+
+static void hello_exit(void);
+
 static int hello_init(void)
 {
+       struct foo_t foo;
+       foo.zomg = 1;
+       foo.lol = 2;
+       foo.bar = 3;
+
        printk("Hello, world!\n");
+       printk("%pR\n", &foo);
+       printk("%pf\n", hello_exit);
        return 0;
 }
 
index 4af0b97cc7f8c1b0fae3fea8f8c40ec1124e730e..79b546a543d846bdadf22abe17c9350b0df8995a 100644 (file)
@@ -268,9 +268,11 @@ static int mf614_do_insn_bits(struct comedi_device *dev,
                return -EINVAL;
        }
 
+       /* The insn data is a mask in data[0] and the new data
+       * in data[1], each channel cooresponding to a bit. */
        if(data[0]) {
-               s->state &= ~data[0];
-               s->state |= data[0] & data[1];
+               s->state &= ~data[0]; // Get old value
+               s->state |= data[0] & data[1]; // Write new value to it
 
                iowrite8(s->state, devpriv->BAR0_io + DOUT_reg);
        }