Re: [PATCH] rust/kernel: Add faux device bindings

From: Danilo Krummrich
Date: Thu Feb 06 2025 - 19:35:51 EST


On Thu, Feb 06, 2025 at 07:21:24PM -0500, Lyude Paul wrote:
> But yeah - I mean, faux::Registration::as_ref::<device::Device>() lets you get
> a device::Device which you can take a reference on using ARef. So you still
> can take a reference count to the device without us adding support for it
> explicitly was what I was getting at.

Yeah, that's true. But it would be nice to have a separate type faux::Device for
that, just like the C struct faux_device only exists to make this obvious given
that it's defined as follows.

struct faux_device {
struct device dev;
};

But I don't think we need that right away. Having a faux::Registration with
as_raw() should be enough for now.