summaryrefslogtreecommitdiff
path: root/schulung_tools/drivers/modules/simplemodule
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:53:07 +0100
committerJohn Ogness <john.ogness@linutronix.de>2017-12-19 10:53:07 +0100
commit27209bb802048f4803d9cd9a5c2f99d613986446 (patch)
tree54f36042b79f63ce0a19be18e82a7d189a41686b /schulung_tools/drivers/modules/simplemodule
parent0f172d0b022f1a2ec3d7465eb7272828ee083f6e (diff)
import drivers from devel/jogness
Simple drivers for use in the Linux Advanced schulung were only available in the devel/jogness branch. Push them to master so they are easily accessible to any trainer. Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'schulung_tools/drivers/modules/simplemodule')
-rw-r--r--schulung_tools/drivers/modules/simplemodule/Makefile19
-rw-r--r--schulung_tools/drivers/modules/simplemodule/simple.c21
2 files changed, 40 insertions, 0 deletions
diff --git a/schulung_tools/drivers/modules/simplemodule/Makefile b/schulung_tools/drivers/modules/simplemodule/Makefile
new file mode 100644
index 0000000..9413c4d
--- /dev/null
+++ b/schulung_tools/drivers/modules/simplemodule/Makefile
@@ -0,0 +1,19 @@
+MNAME=simple
+BDIR=/home/devel/work/build-linux
+
+ifeq ($(KERNELRELEASE),)
+# called from shell
+
+.PHONY: default clean
+
+default:
+ make -C $(BDIR) M=$(shell pwd) modules
+
+clean:
+ rm -rf $(MNAME).mod.* $(MNAME).*o .$(MNAME)* .tmp* Module.symvers modules.order
+
+else
+# called from kernel Makefile
+
+ obj-m := $(MNAME).o
+endif
diff --git a/schulung_tools/drivers/modules/simplemodule/simple.c b/schulung_tools/drivers/modules/simplemodule/simple.c
new file mode 100644
index 0000000..e091f68
--- /dev/null
+++ b/schulung_tools/drivers/modules/simplemodule/simple.c
@@ -0,0 +1,21 @@
+#include <linux/init.h>
+#include <linux/module.h>
+
+static int simple_hello(void)
+{
+ printk(KERN_ERR "called %s\n", __func__);
+ return 0;
+}
+
+static void simple_goodbye(void)
+{
+ printk(KERN_ERR "called %s\n", __func__);
+}
+
+module_init(simple_hello);
+module_exit(simple_goodbye);
+
+MODULE_AUTHOR("John Ogness <john.ogness@linutronix.de>");
+MODULE_DESCRIPTION("simple");
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION("12345.54321");