summaryrefslogtreecommitdiff
path: root/samples/rust/rust_pci_driver/mod.rs
blob: e4e848d7c59d661a85952c8e3dde053a1bf00d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: GPL-2.0

//! Rust PCI driver sample.

mod driver;

use kernel::{pci, prelude::*};

module! {
    type: Module,
    name: "rust_pci_driver_sample",
    author: "Danilo Krummrich",
    description: "Rust PCI driver sample",
    license: "GPL",
}

struct Module {
    _reg: kernel::driver::Registration<pci::Adapter<driver::Driver>>,
}

impl kernel::Module for Module {
    fn init(name: &'static CStr, module: &'static ThisModule) -> Result<Self> {
        Ok(Module {
            _reg: kernel::driver::Registration::new(name, module)?,
        })
    }
}