Re: [PATCH v6 13/16] rust: driver: implement `Adapter`

From: Andreas Hindborg
Date: Thu Dec 19 2024 - 05:53:45 EST



Hi Danilo,

Danilo Krummrich <dakr@xxxxxxxxxx> writes:

> In order to not duplicate code in bus specific implementations (e.g.
> platform), implement a generic `driver::Adapter` to represent the
> connection of matched drivers and devices.
>
> Bus specific `Adapter` implementations can simply implement this trait
> to inherit generic functionality, such as matching OF or ACPI device IDs
> and ID table entries.
>
> Suggested-by: Rob Herring (Arm) <robh@xxxxxxxxxx>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> ---

I get some warnings when applying this patch:

> RUSTC L rust/kernel.o
> warning: unused import: `device_id`
> --> /home/aeh/src/linux-rust/rnvme-v6.13-rc3/rust/kernel/driver.rs:10:13
> |
> 10 | device, device_id, init::PinInit, of, str::CStr, try_pin_init, types::Opaque, ThisModule,
> | ^^^^^^^^^
> |
> = note: `#[warn(unused_imports)]` on by default
>
> warning: missing documentation for an associated function
> --> /home/aeh/src/linux-rust/rnvme-v6.13-rc3/rust/kernel/driver.rs:158:5
> |
> 158 | fn of_id_info(_dev: &device::Device) -> Option<&'static Self::IdInfo> {
> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> |
> = note: requested on the command line with `-W missing-docs`
>
> warning: 2 warnings emitted


Looks like the latter one is from patch 13.


Best regards,
Andreas Hindborg