linux/rust
Danilo Krummrich bfcaf4e8ae rust: io: macro_export io_define_read!() and io_define_write!()
Currently, the define_read!() and define_write!() I/O macros are crate
public. The only user outside of the I/O module is PCI (for the
configurations space I/O backend). Consequently, when CONFIG_PCI=n this
causes a compile time warning [1].

In order to fix this, rename the macros to io_define_read!() and
io_define_write!() and use #[macro_export] to export them.

This is better than making the crate public visibility conditional, as
eventually subsystems will have their own crate.

Also, I/O backends are valid to be implemented by drivers as well. For
instance, there are devices (such as GPUs) that run firmware which
allows to program other devices only accessible through the primary
device through indirect I/O.

Since the macros are now public, also add the corresponding
documentation.

Fixes: 121d87b28e ("rust: io: separate generic I/O helpers from MMIO implementation")
Reported-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Closes: https://lore.kernel.org/driver-core/CANiq72khOYkt6t5zwMvSiyZvWWHMZuNCMERXu=7K=_5tT-8Pgg@mail.gmail.com/ [1]
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Link: https://patch.msgid.link/20260216131534.65008-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
2026-02-23 00:54:02 +01:00
..
bindings Char/Misc/IIO driver changes for 7.0-rc1 2026-02-17 09:11:04 -08:00
helpers USB / Thunderbolt changes for 7.0-rc1 2026-02-17 09:36:43 -08:00
kernel rust: io: macro_export io_define_read!() and io_define_write!() 2026-02-23 00:54:02 +01:00
macros Rust changes for v6.20 / v7.0 2026-02-10 11:53:01 -08:00
pin-init Rust fixes for v7.0-rc1 2026-02-22 08:43:31 -08:00
proc-macro2 rust: proc-macro2: rebuild if the version text changes 2026-01-23 10:44:27 +01:00
quote rust: quote: add README.md 2025-11-24 17:15:43 +01:00
syn rust: syn: add README.md 2025-11-24 17:15:47 +01:00
uapi Char/Misc/IIO/Binder changes for 6.18-rc1 2025-10-04 16:26:32 -07:00
.gitignore rust: support running Rust documentation tests as KUnit ones 2023-07-19 09:32:53 -06:00
.kunitconfig rust: add kunitconfig 2025-03-19 23:22:21 +01:00
bindgen_parameters mm: declare VMA flags by bit 2025-11-29 10:41:08 -08:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs ARM: 9441/1: rust: Enable Rust support for ARMv7 2025-03-26 13:31:16 +00:00
exports.c rust: exports: improve grammar in commentary 2024-10-21 17:35:33 +02:00
ffi.rs rust: replace CStr with core::ffi::CStr 2025-10-22 07:47:27 +02:00
Makefile Rust fixes for v7.0-rc1 2026-02-22 08:43:31 -08:00