From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: device: make Core and CoreInternal lifetime-parameterized Date: Mon, 25 May 2026 19:29:14 +1000 Message-ID: In-Reply-To: <20260521233501.1191842-11-dakr@kernel.org> References: <20260521233501.1191842-1-dakr@kernel.org> <20260521233501.1191842-11-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review Converts `Core` and `CoreInternal` from unit structs to `Core<'a>(PhantomData<&'a ()>)`. This threads a lifetime through the device reference in probe callbacks, changing signatures from `&Device` to `&Device>`. The change propagates through all bus adapters and samples. The DMA module trait also gains a lifetime parameter: `pub trait Device<'a>: AsRef>>`. This is a large mechanical change (27 files) but necessary for the probe signature to carry a lifetime that `Data<'bound>` can borrow from. No issues. --- ### PATCHES 11-15/27: make Driver traits lifetime-parameterized Five patches applying the same pattern across PCI, platform, auxiliary, USB, and I2C. The key change in each: ```rust // Before: type Data: Send; fn probe(dev: &Device>, ...) -> impl PinInit; // After: type Data<'bound>: Send + 'bound; fn probe<'bound>(dev: &'bound Device>, ...) -> impl PinInit, Error> + 'bound; ``` The `'bound` lifetime on probe connects the device reference lifetime to the Data type, enabling Data to borrow from the device. The `+ 'bound` on the return type ensures the PinInit doesn't outlive the borrow. These are applied consistently. All existing drivers use `type Data<'bound> = Self` (no lifetime parameter on Self), maintaining backward compatibility. No issues. --- --- Generated by Claude Code Patch Reviewer