aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-04-21 16:15:43 +0200
committerlonkaars <loek@pipeframe.xyz>2024-04-21 16:15:43 +0200
commit8903de385d0baf4bc80231113b49dae46436bd69 (patch)
treec46929cf00cccaf01c297911fdc4a714cbfa0c05
parentbacaaf0b7595730904613e86d40400f72682904d (diff)
add module parametersweek-1
-rw-r--r--1/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/1/main.c b/1/main.c
index d441f19..5410df7 100644
--- a/1/main.c
+++ b/1/main.c
@@ -5,6 +5,14 @@
#include "fopdrv.h"
#include "config.h"
+int one = 0;
+module_param(one, int, 0400);
+MODULE_PARM_DESC(one, "first parameter, only printed on init");
+
+int not_named_two = 0;
+module_param_named(two, not_named_two, int, 0400);
+MODULE_PARM_DESC(not_named_two, "second parameter, only printed on init");
+
struct cdev *cdev;
struct device *dev;
struct class *class;
@@ -54,6 +62,7 @@ static int mod_init(void) {
}
printk("%s() -> 0 (%d:%d)\n", __PRETTY_FUNCTION__, MAJOR(node), MINOR(node));
+ printk("one = %d, two = %d\n", one, not_named_two);
return 0;
free_device: