linux/rust/helpers
Danilo Krummrich a38dfd60fe 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: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno 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: Danilo Krummrich <dakr@kernel.org>
2025-04-19 10:20:25 +02:00
..
blk.c rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
bug.c rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
build_assert.c
build_bug.c rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00
cpumask.c rust: Add cpumask helpers 2025-02-28 13:34:40 -05:00
cred.c rust: cred: add Rust abstraction for struct cred 2024-09-30 13:02:28 +02:00
device.c rust: add devres abstraction 2024-12-20 17:19:26 +01:00
err.c rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00
fs.c rust: file: add Rust abstraction for struct file 2024-09-30 13:02:28 +02:00
helpers.c Locking changes for v6.15: 2025-03-24 20:55:03 -07:00
io.c rust: add io::{Io, IoRaw} base types 2024-12-20 17:19:26 +01:00
jump_label.c rust: add static_branch_unlikely for static_key_false 2024-11-04 16:21:44 -05:00
kunit.c rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00
mutex.c rust: sync: Add lock::Backend::assert_is_held() 2024-12-19 14:04:42 -08:00
page.c rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
pci.c rust: pci: impl TryFrom<&Device> for &pci::Device 2025-04-19 10:20:16 +02:00
pid_namespace.c rust: add PidNamespace 2024-10-08 15:44:36 +02:00
platform.c rust: platform: impl TryFrom<&Device> for &platform::Device 2025-04-19 10:20:25 +02:00
rbtree.c rust: rbtree: add red-black tree implementation backed by the C version 2024-08-31 17:35:08 +02:00
rcu.c rust: add rcu abstraction 2024-12-20 17:19:26 +01:00
refcount.c rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00
security.c rust: replace lsm context+len with lsm_context 2024-12-04 15:02:29 -05:00
signal.c rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00
slab.c rust: alloc: implement KVmalloc allocator 2024-10-15 22:56:59 +02:00
spinlock.c rust: sync: Add lock::Backend::assert_is_held() 2024-12-19 14:04:42 -08:00
sync.c rust: lockdep: Use Pin for all LockClassKey usages 2025-03-08 00:55:04 +01:00
task.c Rust changes for v6.13 2024-11-26 14:00:26 -08:00
uaccess.c rust: kbuild: auto generate helper exports 2024-08-19 11:09:02 +02:00
vmalloc.c rust: alloc: implement Vmalloc allocator 2024-10-15 22:56:59 +02:00
wait.c rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00
workqueue.c rust: helpers: remove unnecessary header includes 2024-10-21 17:35:59 +02:00