Re: [PATCH v2 3/6] rust: device: Support testing devices for equality
From: Gary Guo
Date: Tue Feb 03 2026 - 11:09:37 EST
On Tue Feb 3, 2026 at 3:46 PM GMT, Matthew Maurer wrote:
> This allows device drivers to check if, for example, an auxiliary
> devices is one of its children by comparing the parent field, or
> checking if a device parameter is its own device.
>
> Also convert existing `.as_raw() != .as_raw()` to use this new
> implementation.
>
> Signed-off-by: Matthew Maurer <mmaurer@xxxxxxxxxx>
Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>
> ---
> rust/kernel/device.rs | 8 ++++++++
> rust/kernel/devres.rs | 2 +-
> rust/kernel/drm/driver.rs | 2 +-
> rust/kernel/pwm.rs | 2 +-
> 4 files changed, 11 insertions(+), 3 deletions(-)