Re: [PATCH v2 00/12] rust: driver: use pointers instead of indices for ID info
"Gary Guo" <[email protected]>
| Newsgroups | org.kernel.vger.linux-pwm,dev.linux.lists.driver-core,dev.linux.lists.nova-gpu,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-acpi,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci,org.kernel.vger.linux-pm,org.kernel.vger.linux-usb,org.kernel.vger.netdev,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Mon Jun 29, 2026 at 1:38 PM BST, Gary Guo wrote: > Most C drivers use a pointer (and cast to kernel_ulong_t) for driver_data > fields in device_id. Rust code currently does not do this, but rather use > indices. These indices then needs to be translated to `&IdInfo` separately > and this is by a side table. > > This leads to open-coded ACPI/OF handling in driver.rs, which is not > desirable. Convert the code to use pointers (or rather, static references) > instead. > > Signed-off-by: Gary Guo <[email protected]> > --- > Changes in v2: > - Change USB to take `Option<&IdInfo>` in addition to PCI due to ability to > dynamically add IDs. > - Mention dyn IDs and driver_override in safety comments and justify why > they're correct. > - Link to v1: https://patch.msgid.link/[email protected] Oops, this cover letter is sent by mistake. Please see the 11-patch series. Best, Gary