Skip to content

Commit 891b952

Browse files
authored
Merge pull request #128 from Rust-for-Linux/alex-patch-1
fixes #127 -- added a comment to clarify an example
2 parents 7ea525c + 80cce19 commit 891b952

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/char/rust_example.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ impl KernelModule for RustExample {
136136

137137
let mut chrdev_reg =
138138
chrdev::Registration::new_pinned(cstr!("rust_chrdev"), 0, &THIS_MODULE)?;
139+
// Register the same kind of device twice, we're just demonstrating
140+
// that you can use multiple minors. There are two minors in this case
141+
// because its type is `chrdev::Registration<2>`
139142
chrdev_reg.as_mut().register::<RustFile>()?;
140143
chrdev_reg.as_mut().register::<RustFile>()?;
141144

0 commit comments

Comments
 (0)