<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/rust/kernel/device, branch master</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=master</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-12-22T16:30:24Z</updated>
<entry>
<title>rust: device: replace `kernel::c_str!` with C-Strings</title>
<updated>2025-12-22T16:30:24Z</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2025-12-22T12:35:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0c6ea853bd7f48aeec231e9378fc17cf36b9109'/>
<id>urn:sha1:f0c6ea853bd7f48aeec231e9378fc17cf36b9109</id>
<content type='text'>
C-String literals were added in Rust 1.77. Replace instances of
`kernel::c_str!` with C-String literals where possible.

Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Reviewed-by: Daniel Almeida &lt;daniel.almeida@collabora.com&gt;
Link: https://patch.msgid.link/20251222-cstr-driver-core-v1-2-1142a177d0fd@gmail.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: Update ARef and AlwaysRefCounted imports from sync::aref</title>
<updated>2025-12-18T16:23:48Z</updated>
<author>
<name>Shankari Anand</name>
<email>shankari.ak0208@gmail.com</email>
</author>
<published>2025-11-23T09:24:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e2b4135d1cb32fc310f21e395ee7313a3681bee'/>
<id>urn:sha1:2e2b4135d1cb32fc310f21e395ee7313a3681bee</id>
<content type='text'>
Update call sites to import `ARef` and `AlwaysRefCounted`
from `sync::aref` instead of `types`.

This aligns with the ongoing effort to move `ARef` and
`AlwaysRefCounted` to sync.

Suggested-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/linux/issues/1173
Signed-off-by: Shankari Anand &lt;shankari.ak0208@gmail.com&gt;
Link: https://patch.msgid.link/20251123092438.182251-4-shankari.ak0208@gmail.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: use `kernel::{fmt,prelude::fmt!}`</title>
<updated>2025-09-16T07:26:59Z</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2025-08-13T15:39:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb98599528ebee9b660d98ae6613c2f2966e0dbb'/>
<id>urn:sha1:eb98599528ebee9b660d98ae6613c2f2966e0dbb</id>
<content type='text'>
Reduce coupling to implementation details of the formatting machinery by
avoiding direct use for `core`'s formatting traits and macros.

Signed-off-by: Tamir Duberstein &lt;tamird@gmail.com&gt;
Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: implement FwNode::is_of_node()</title>
<updated>2025-06-25T16:10:12Z</updated>
<author>
<name>Danilo Krummrich</name>
<email>dakr@kernel.org</email>
</author>
<published>2025-06-20T15:15:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56a789f776f24e6b132ec00d4c27672ed4e2ec57'/>
<id>urn:sha1:56a789f776f24e6b132ec00d4c27672ed4e2ec57</id>
<content type='text'>
Implement FwNode::is_of_node() in order to check whether a FwNode
instance is embedded in a struct device_node.

Reviewed-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Igor Korotin &lt;igor.korotin.linux@gmail.com&gt;
Link: https://lore.kernel.org/r/20250620151504.278766-1-igor.korotin.linux@gmail.com
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: Add property_get_reference_args</title>
<updated>2025-06-25T15:47:13Z</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-16T15:45:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c3e05bd15e0c99f3ff45e0b1f01814778bc1128c'/>
<id>urn:sha1:c3e05bd15e0c99f3ff45e0b1f01814778bc1128c</id>
<content type='text'>
Allow Rust code to read reference args from device properties. The
wrapper type `FwNodeReferenceArgs` allows callers to access the buffer
of read args safely.

Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250616154511.1862909-3-remo@buenzli.dev
[ Move up NArgs; refer to FwNodeReferenceArgs in NArgs doc-comment.
  - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: Add child accessor and iterator</title>
<updated>2025-06-25T15:18:07Z</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-16T15:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c942dba38064cd35214c6b3249120f3f2945e810'/>
<id>urn:sha1:c942dba38064cd35214c6b3249120f3f2945e810</id>
<content type='text'>
Allow Rust drivers to access children of a fwnode either by name or by
iterating over all of them.

In C, there is the function `fwnode_get_next_child_node` for iteration
and the macro `fwnode_for_each_child_node` that helps with handling the
pointers. Instead of a macro, a native iterator is used in Rust such
that regular for-loops can be used.

Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250616154511.1862909-2-remo@buenzli.dev
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: Implement accessors for firmware properties</title>
<updated>2025-06-12T22:58:53Z</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-11T10:29:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2db611374cef12bd793b72d5728f0ecd1affeb17'/>
<id>urn:sha1:2db611374cef12bd793b72d5728f0ecd1affeb17</id>
<content type='text'>
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 &lt;dirk.behme@de.bosch.com&gt;
Co-developed-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Rob Herring (Arm) &lt;robh@kernel.org&gt;
Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
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 &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: Introduce PropertyGuard</title>
<updated>2025-06-12T22:58:53Z</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-11T10:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9bd791d9413b4b65e203c4ff84c8b8b2c8c3b770'/>
<id>urn:sha1:9bd791d9413b4b65e203c4ff84c8b8b2c8c3b770</id>
<content type='text'>
This abstraction is a way to force users to specify whether a property
is supposed to be required or not. This allows us to move error
logging of missing required properties into core, preventing a lot of
boilerplate in drivers.

It will be used by upcoming methods for reading device properties.

Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250611102908.212514-6-remo@buenzli.dev
[ Use prelude::* to avoid build failure; move PropertyGuard below Display
  impl of FwNode. - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: Enable printing fwnode name and path</title>
<updated>2025-06-12T22:58:52Z</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-11T10:29:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ecea2459818383c2886ec1cff81cce7e70d99893'/>
<id>urn:sha1:ecea2459818383c2886ec1cff81cce7e70d99893</id>
<content type='text'>
Add two new public methods `display_name` and `display_path` to
`FwNode`. They can be used by driver authors for logging purposes. In
addition, they will be used by core property abstractions for automatic
logging, for example when a driver attempts to read a required but
missing property.

Tested-by: Dirk Behme &lt;dirk.behme@de.bosch.com&gt;
Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250611102908.212514-5-remo@buenzli.dev
[ Remove #[expect(dead_code)] from FwNode::from_raw(). - Danilo ]
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: device: Move property_present() to FwNode</title>
<updated>2025-06-12T22:58:52Z</updated>
<author>
<name>Remo Senekowitsch</name>
<email>remo@buenzli.dev</email>
</author>
<published>2025-06-11T10:29:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d3393e845038f5fd32c24b841bb4b6026aa1cf4b'/>
<id>urn:sha1:d3393e845038f5fd32c24b841bb4b6026aa1cf4b</id>
<content type='text'>
The new FwNode abstraction will be used for accessing all device
properties.

It would be possible to duplicate the methods on the device itself, but
since some of the methods on Device would have different type sigatures
as the ones on FwNode, this would only lead to inconsistency and
confusion. For this reason, property_present is removed from Device and
existing users are updated.

Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Remo Senekowitsch &lt;remo@buenzli.dev&gt;
Link: https://lore.kernel.org/r/20250611102908.212514-4-remo@buenzli.dev
Signed-off-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
</content>
</entry>
</feed>
