rust: dma: convert the read/write macros to return Result
authorAbdiel Janulgue <abdiel.janulgue@gmail.com>
Mon, 2 Jun 2025 08:53:12 +0000 (11:53 +0300)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 23 Jun 2025 13:34:13 +0000 (15:34 +0200)
commitfe58465905550576cc47cf93efeaaa6990e6c3b3
treedd1d6f1b3bf3804678c8d05c87c69641c2c9debe
parent9863f7743339ae53a0cf80e5f229cf6d2a42a6e6
rust: dma: convert the read/write macros to return Result

We could do better here by having the macros return `Result`,
so that we don't have to wrap these calls in a closure for
validation which is confusing.

Co-developed-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Link: https://lore.kernel.org/rust-for-linux/87h63qhz4q.fsf@kernel.org/
Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@gmail.com>
Link: https://lore.kernel.org/r/20250602085444.1925053-3-abdiel.janulgue@gmail.com
[ Fix line length in dma_read!(). - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/dma.rs
samples/rust/rust_dma.rs