Commit a38dfd60 authored by Danilo Krummrich's avatar Danilo Krummrich
Browse files

rust: platform: impl TryFrom<&Device> for &platform::Device



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: default avatarAlice Ryhl <aliceryhl@google.com>
Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
Link: https://lore.kernel.org/r/20250321214826.140946-4-dakr@kernel.org


[ Support device context types, use dev_is_platform() helper. - Danilo ]
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent a095d0d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment