diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c index 609689fba3dd..2c5eecc091c4 100644 --- a/rust/helpers/helpers.c +++ b/rust/helpers/helpers.c @@ -57,8 +57,8 @@ #include "cred.c" #include "device.c" #include "dma.c" -#include "dma_fence.c" #ifdef CONFIG_DMA_SHARED_BUFFER +#include "dma_fence.c" #include "dma-resv.c" #endif #include "drm.c" diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 72f5527ba66c..f9ef36217bb5 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -67,6 +67,7 @@ pub mod device_id; pub mod devres; pub mod dma; +#[cfg(CONFIG_DMA_SHARED_BUFFER)] pub mod dma_buf; pub mod driver; #[cfg(CONFIG_DRM = "y")]