From: Markus Probst <markus.probst@posteo.de>
Add visibility argument to macro to allow defining an of device table in
a different module than the driver, which can improve readability.
Signed-off-by: Markus Probst <markus.probst@posteo.de>
---
rust/kernel/of.rs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/rust/kernel/of.rs b/rust/kernel/of.rs
index 58b20c367f99..a0de98a23416 100644
--- a/rust/kernel/of.rs
+++ b/rust/kernel/of.rs
@@ -53,8 +53,9 @@ pub const fn new(compatible: &'static CStr) -> Self {
/// Create an OF `IdTable` with an "alias" for modpost.
#[macro_export]
macro_rules! of_device_table {
- ($table_name:ident, $module_table_name:ident, $id_info_type: ty, $table_data: expr) => {
- const $table_name: $crate::device_id::IdArray<
+ ($table_vis:vis $table_name:ident, $module_table_name:ident, $id_info_type: ty,
+ $table_data: expr) => {
+ $table_vis const $table_name: $crate::device_id::IdArray<
$crate::of::DeviceId,
$id_info_type,
{ $table_data.len() },
--
2.52.0