Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ WARN_FLAGS += -Wall

.PHONY: default
defualt:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
$(MAKE) -C $(KDIR) M=$(PWD) modules
8 changes: 1 addition & 7 deletions example1/debugfs_example1.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ static u32 hello = 0;
// This is called when the module loads.
int init_module(void)
{
struct dentry *junk;

// Create directory `/sys/kernel/debug/example1`.
//
Expand Down Expand Up @@ -53,12 +52,7 @@ int init_module(void)
//
// See also linux-source/fs/debugfs/file.c:debugfs_create_u32
//
junk = debugfs_create_u32("hello", 0666, dir, &hello);
if (!junk) {
// Abort module load.
printk(KERN_ALERT "debugfs_example1: failed to create /sys/kernel/debug/example1/hello\n");
return -1;
}
debugfs_create_u32("hello", 0666, dir, &hello);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion example2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ WARN_FLAGS += -Wall

.PHONY: default
defualt:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
$(MAKE) -C $(KDIR) M=$(PWD) modules
7 changes: 1 addition & 6 deletions example2/debugfs_example2.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,7 @@ int init_module(void)
//
// See also linux-source/fs/debugfs/file.c:debugfs_create_u32
//
junk = debugfs_create_u32("sum", 0444, dir, &sum);
if (!junk) {
// Abort module load.
printk(KERN_ALERT "debugfs_example2: failed to create /sys/kernel/debug/example2/add\n");
return -1;
}
debugfs_create_u32("sum", 0444, dir, &sum);

return 0;
}
Expand Down