diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
index 11566b73ae1443019571d3e256cda70cd861d7b8..b609357b8ed3267be89d5f72b971258ffd0bb57f 100644
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@ -60,6 +60,8 @@ pub mod miscdevice;
 pub mod net;
 pub mod of;
 pub mod page;
+#[cfg(CONFIG_PCI)]
+pub mod pci;
 pub mod pid_namespace;
 pub mod platform;
 pub mod prelude;
@@ -86,8 +88,6 @@ pub mod workqueue;
 pub use bindings;
 pub mod io;
 pub use macros;
-#[cfg(all(CONFIG_PCI, CONFIG_PCI_MSI))]
-pub mod pci;
 pub use uapi;
 
 /// Prefix to appear before log messages printed from within the `kernel` crate.