Re: [RFC PATCH v2 1/4] i2c: rust: add smbus_read_byte_data and smbus_read_word_data

From: Muchamad Coirul Anwar

Date: Wed May 06 2026 - 03:46:40 EST


On Mon, 4 May 2026 at 17:29, Igor Korotin <igor.korotin@xxxxxxxxx> wrote:
>
> Hello Muchamad
>
> On 4/29/2026 2:22 PM, Muchamad Coirul Anwar wrote:
> > Signed-off-by: Muchamad Coirul Anwar <muchamadcoirulanwar@xxxxxxxxx>
> > ---
> > rust/kernel/i2c.rs | 24 ++++++++++++++++++++++++
> > 1 file changed, 24 insertions(+)
[snip]
>
> Thanks for the patch. However, we've previously agreed [1] that
> I2cClient should implement the IO trait [2] rather than adding
> standalone methods like these. This patch would need to be reworked in
> that direction.
>
> If you'd like to take that on, feel free to submit a patch series
> implementing the IO trait instead.
>
> Cheers
> Igor
>
> [1] https://lore.kernel.org/rust-for-linux/20260131-i2c-adapter-v1-4-5a436e34cd1a@xxxxxxxxx/
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/commit/?h=driver-core-testing&id=121d87b28e1d9061d3aaa156c43a627d3cb5e620

Hi Igor,

Thanks for the review. It makes sense that having the AS5600 as the
first consumer of the Io trait would be cleaner than using standalone
methods. I'll rework this accordingly.

Quick question on logistics: would you prefer the Io trait patches as
a separate series, or bundled as prerequisites in my v3 for the AS5600
driver?

Regards,
M. Coirul A.