Re: [PATCH v5 2/8] rust: firmware: add request_into_buf()

"Alexandre Courbot" <[email protected]> Mon, 27 Jul 2026 19:38:19 +0900
Newsgroups dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Sat Jul 11, 2026 at 8:04 AM JST, Timur Tabi wrote:
> Add request_into_buf(), a Rust wrapper around the
> request_firmware_into_buf() function. This variant loads the firmware
> image directly into a caller-provided buffer rather than a
> kernel-allocated one.
>
> Signed-off-by: Timur Tabi <[email protected]>
> Reviewed-by: Alexandre Courbot <[email protected]>
> ---
>  rust/kernel/firmware.rs | 49 +++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 47 insertions(+), 2 deletions(-)
>
> diff --git a/rust/kernel/firmware.rs b/rust/kernel/firmware.rs
> index 71168d8004e2..84b499ca822f 100644
> --- a/rust/kernel/firmware.rs
> +++ b/rust/kernel/firmware.rs
> @@ -7,13 +7,14 @@
>  use crate::{
>      bindings,
>      device::Device,
> -    error::Error,
> -    error::Result,
> +    error::to_result,
>      ffi,
>      str::{CStr, CStrExt as _},
>  };
>  use core::ptr::NonNull;
> =20
> +use kernel::prelude::*;

Also this should be moved to the `crate` import block above.