Re: [PATCH v8 3/5] rust: add basic serial device bus abstractions

From: Danilo Krummrich

Date: Sat May 30 2026 - 10:15:45 EST


On Sat May 30, 2026 at 4:00 PM CEST, Markus Probst wrote:
> On Sat, 2026-05-30 at 15:53 +0200, Markus Probst wrote:
>> On Sat, 2026-05-30 at 15:37 +0200, Markus Probst wrote:
>> > If I think about it, I can't even close it inside remove_callback after
>> > `T::unbind`. With the driver lifetimes, the driver could store the
>> > `serdev::Device<Bound>` pointer in its DriverData and could still make
>> > calls to the device.
>> >
>> > Any suggestions?

Now that there is no public drvdata() accessor anymore, all bus device private
data accesses go through the bus abstraction.

So, you could go back to your original approach and wrap the state in a bus
specific bus device private data wrapper type, which would also get you rid of
the rust_private_data pointer you add to struct serdev_device.