#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;
}
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);
}