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: Sun, 12 Apr 2026 08:55:17 +1000 Message-ID: In-Reply-To: <20260411-rust_serdev-v4-4-845e960c6627@posteo.de> References: <20260411-rust_serdev-v4-0-845e960c6627@posteo.de> <20260411-rust_serdev-v4-4-845e960c6627@posteo.de> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review A clean sample that demonstrates probe, receive (echo/loopback), and cleanup. A few observations: **Error in receive is swallowed**: ```rust + fn receive(sdev: &serdev::Device, _this: Pin<&Self>, data: &[u8]) -> usize { + let _ = sdev.write_all(data, serdev::Timeout::Max); + data.len() + } ``` The `write_all` error is discarded with `let _ = ...`. For a sample this is acceptable, but a comment like `// Ignore write errors for simplicity` would be helpful. **Strict baudrate matching**: ```rust + if sdev + .set_baudrate(...) + .is_err() + { + return Err(EINVAL); + } ``` This fails probe if the exact baudrate isn't matched. As noted above, many serial controllers approximate the baudrate. For a sample this is fine, but it could be confusing if someone tries to run this on real hardware. **License string**: `"GPL v2"` is used, which is the correct form for `MODULE_LICENSE`. **Overall the sample is clean and well-structured**, demonstrating the key abstractions (OF/ACPI ID tables, probe, receive, device reference management via `ARef`, Drop-based cleanup). --- Generated by Claude Code Patch Reviewer