Re: [PATCH 0/7] rust: treewide: remove driver unbind callbacks

From: Danilo Krummrich

Date: Thu Nov 12 2026 - 10:20:55 EST


On Thu Nov 12, 2026 at 10:47 AM CET, Gary Guo wrote:
> On Thu Nov 12, 2026 at 12:52 AM GMT, Danilo Krummrich wrote:
>> The driver model uses native Rust lifetimes, allowing driver data to
>> retain device resources and a bound device reference for use in its
>> destructor. Separate teardown callbacks are therefore no longer needed.
>>
>> Remove unbind() from the PCI, platform, auxiliary, serdev and I2C driver
>> traits, and disconnect() from the USB driver trait. Move the affected
>> sample teardown into destructors and update the driver documentation.
>
> unbind() has the `Device<Core>` state, which the destructor won't be able to
> get. Are we sure we won't need it in the future?

Yeah, unbind() was only ever meant to provide a Device<Bound>, so drivers could
access device resources (such as I/O memory) to communicate with the device for
teardown.