Commit bc4f9045 authored by Daniel Almeida's avatar Daniel Almeida Committed by Danilo Krummrich
Browse files

rust: platform: add resource accessors



The previous patches have added the abstractions for Resources and the
ability to map them and therefore read and write the underlying memory .

The only thing missing to make this accessible for platform devices is
to provide accessors that return instances of IoRequest<'a>. These
ensure that the resource are valid only for the lifetime of the platform
device, and that the platform device is in the Bound state.

Therefore, add these accessors. Also make it possible to retrieve
resources from platform devices in Rust using either a name or an index.

Acked-by: default avatarMiguel Ojeda <ojeda@kernel.org>
Signed-off-by: default avatarDaniel Almeida <daniel.almeida@collabora.com>
Link: https://lore.kernel.org/r/20250717-topics-tyr-platform_iomem-v15-3-beca780b77e3@collabora.com


[ Remove #[expect(dead_code)] from IoRequest::new() and move SAFETY
  comments right on top of unsafe blocks to avoid clippy warnings for
  some (older) clippy versions. - Danilo ]
Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parent 1d0d4b28
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment