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

Danilo Krummrich
2025-02-07T00:35:43Z

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.