diff options
author | Remo Senekowitsch <remo@buenzli.dev> | 2025-06-11 12:29:05 +0200 |
---|---|---|
committer | Danilo Krummrich <dakr@kernel.org> | 2025-06-13 00:58:53 +0200 |
commit | 2db611374cef12bd793b72d5728f0ecd1affeb17 (patch) | |
tree | 64fca45b937222d32d8e657af5d4e1bada23f399 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |
parent | 9bd791d9413b4b65e203c4ff84c8b8b2c8c3b770 (diff) |
rust: device: Implement accessors for firmware properties
Add methods to FwNode for reading several firmware property types like
strings, integers and arrays.
Most types are read with the generic `property_read` method. There are
two exceptions:
* `property_read_bool` cannot fail, so the fallible function signature
of `property_read` would not make sense for reading booleans.
* `property_read_array_vec` can fail because of a dynamic memory
allocation. This error must be handled separately, leading to a
different function signature than `property_read`.
The traits `Property` and `PropertyInt` drive the generic behavior
of `property_read`. `PropertyInt` is necessary to associate
specific integer types with the C functions to read them. While
there is a C function to read integers of generic sizes called
`fwnode_property_read_int_array`, it was preferred not to make this
public.
Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
Co-developed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
Link: https://lore.kernel.org/r/20250611102908.212514-7-remo@buenzli.dev
[ Properly include kernel::device::private::Sealed; add explicit type
annotations for core::mem::transmute(). - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
0 files changed, 0 insertions, 0 deletions