diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-08-13 13:52:30 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-08-13 13:52:30 -0700 |
commit | 50470d3899cdf06fd58def74dec87f31e13cda6f (patch) | |
tree | 9d4d04c0c394f079127752d6d5b796aa33b903ca /rust/macros/module.rs | |
parent | 4a4c013d3385b0db85dc361203dc42ff048b6fd6 (diff) | |
parent | de12c3391bce10504c0e7bd767516c74110cfce1 (diff) |
Merge remote-tracking branch 'vfs/stable-struct_fd'
Merge Al Viro's struct fd refactorings.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'rust/macros/module.rs')
-rw-r--r-- | rust/macros/module.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/rust/macros/module.rs b/rust/macros/module.rs index acd0393b5095..411dc103d82e 100644 --- a/rust/macros/module.rs +++ b/rust/macros/module.rs @@ -97,14 +97,22 @@ struct ModuleInfo { author: Option<String>, description: Option<String>, alias: Option<Vec<String>>, + firmware: Option<Vec<String>>, } impl ModuleInfo { fn parse(it: &mut token_stream::IntoIter) -> Self { let mut info = ModuleInfo::default(); - const EXPECTED_KEYS: &[&str] = - &["type", "name", "author", "description", "license", "alias"]; + const EXPECTED_KEYS: &[&str] = &[ + "type", + "name", + "author", + "description", + "license", + "alias", + "firmware", + ]; const REQUIRED_KEYS: &[&str] = &["type", "name", "license"]; let mut seen_keys = Vec::new(); @@ -131,6 +139,7 @@ impl ModuleInfo { "description" => info.description = Some(expect_string(it)), "license" => info.license = expect_string_ascii(it), "alias" => info.alias = Some(expect_string_array(it)), + "firmware" => info.firmware = Some(expect_string_array(it)), _ => panic!( "Unknown key \"{}\". Valid keys are: {:?}.", key, EXPECTED_KEYS @@ -186,6 +195,11 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream { modinfo.emit("alias", &alias); } } + if let Some(firmware) = info.firmware { + for fw in firmware { + modinfo.emit("firmware", &fw); + } + } // Built-in modules also export the `file` modinfo string. let file = |