Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 4c2ed2a3dbda5cad4d7b2f5f394c91522abbaa92 33 lines 670 B view raw
1// SPDX-License-Identifier: GPL-2.0-only 2 3//! Rust faux device sample. 4 5use kernel::{ 6 faux, 7 prelude::*, 8 Module, // 9}; 10 11module! { 12 type: SampleModule, 13 name: "rust_faux_driver", 14 authors: ["Lyude Paul"], 15 description: "Rust faux device sample", 16 license: "GPL", 17} 18 19struct SampleModule { 20 _reg: faux::Registration, 21} 22 23impl Module for SampleModule { 24 fn init(_module: &'static ThisModule) -> Result<Self> { 25 pr_info!("Initialising Rust Faux Device Sample\n"); 26 27 let reg = faux::Registration::new(c"rust-faux-sample-device", None)?; 28 29 dev_info!(reg, "Hello from faux device!\n"); 30 31 Ok(Self { _reg: reg }) 32 } 33}