Something went wrong. Try again.
(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435// SPDX-License-Identifier: GPL-2.0-only
//! Rust faux device sample.
use kernel::{ faux, prelude::*, Module, //};
module! { type: SampleModule, name: "rust_faux_driver", authors: ["Lyude Paul"], description: "Rust faux device sample", license: "GPL",}
struct SampleModule { _reg: faux::Registration,}
impl Module for SampleModule { fn init(_module: &'static ThisModule) -> Result<Self> { pr_info!("Initialising Rust Faux Device Sample\n");
let reg = faux::Registration::new(c"rust-faux-sample-device", None)?; let fdev = reg.as_ref();
dev_info!(fdev, "Hello from faux device!\n");
Ok(Self { _reg: reg }) }}