On Sat, 2026-01-31 at 14:12 +0000, Igor Korotin via B4 Relay wrote: > From: Igor Korotin > > Add safe Rust wrappers for common I2C/SMbus operations on I2C clients. > > These wrappers provide safe abstractions over low-level C API calls: > - SMbus byte operations: read/write byte and byte data > - SMbus word operations: read/write word data > - SMbus block operations: read/write I2C block data > - Master I2C operations: master receive and master send > > All operations include proper error handling through the Result type. > > Signed-off-by: Igor Korotin > --- > rust/helpers/helpers.c | 1 + > rust/helpers/i2c.c | 15 ++++++++ > rust/kernel/i2c/client.rs | 92 +++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 108 insertions(+) > I think I2CClient should implement the IO [1] trait instead, as suggested by Danilo [2]. Also I think it is a little odd that read and write is possible, on I2CClient and not I2CClient. Shouldn't the assigned driver have exclusive read and write access to the device? Thanks - Markus Probst [1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/commit/?h=driver-core-testing&id=121d87b28e1d9061d3aaa156c43a627d3cb5e620 [2] https://lore.kernel.org/rust-for-linux/DDDS2V0V2NVJ.16ZKXCKUA1HUV@kernel.org/