Re: [PATCH v4 3/3] rust: platform: impl TryFrom<&Device> for &platform::Device

From: Greg KH
Date: Fri Mar 21 2025 - 23:27:08 EST


On Fri, Mar 21, 2025 at 10:47:55PM +0100, Danilo Krummrich wrote:
> Implement TryFrom<&device::Device> for &Device.
>
> This allows us to get a &platform::Device from a generic &Device in a safe
> way; the conversion fails if the device' bus type does not match with
> the platform bus type.
>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Reviewed-by: Benno Lossin <benno.lossin@xxxxxxxxx>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> ---
> rust/kernel/platform.rs | 25 +++++++++++++++++++++++--
> 1 file changed, 23 insertions(+), 2 deletions(-)

Same comment as on the pci one, let's figure out if we really want this
before it gets merged please.

thanks,

greg k-h