From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: samples: rust: add Rust serial device bus sample device driver Date: Thu, 04 Jun 2026 11:33:18 +1000 Message-ID: In-Reply-To: <20260603-rust_serdev-v12-2-3400ffb88b12@posteo.de> References: <20260603-rust_serdev-v12-0-3400ffb88b12@posteo.de> <20260603-rust_serdev-v12-2-3400ffb88b12@posteo.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This is a clean, minimal sample driver that demonstrates the serdev abstrac= tion. **1. Probe error handling =E2=80=94 discards actual baudrate on error (line= s 220=E2=80=93229):** ```rust if sdev .set_baudrate( dev.fwnode() .and_then(|fwnode| fwnode.property_read(c"baudrate").optional()) .unwrap_or(115200), ) .is_err() { return Err(EINVAL); } ``` `set_baudrate` returns `Result<(), u32>` where the `Err(u32)` contains the = actual baudrate that was set. The sample discards this. Fine for a sample, = but a real driver might want to log or use the actual rate. **2. `receive` callback echoes data =E2=80=94 good illustrative choice:** ```rust fn receive<'bound>( sdev: &'bound serdev::Device, _this: Pin<&Self>, data: &[u8], ) -> usize { let _ =3D sdev.write_all(data, serdev::Timeout::Max); data.len() } ``` The echo pattern is a good sample. Ignoring the `write_all` result with `le= t _ =3D ...` is acceptable here since there's no meaningful recovery in a s= ample echo driver. **3. Kconfig correctly selects `RUST_SERIAL_DEV_BUS_ABSTRACTIONS`.** No issues. --- --- Generated by Claude Code Patch Reviewer