summaryrefslogtreecommitdiff
path: root/samples/rust/rust_pci_driver/mod.rs
blob: cd40a167e91c6239286bfed006d3c9c2907a9ae0 (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: pci::Registration<driver::Driver>,
}

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