Re: [PATCH v4 2/3] dax/bus: Introduce guard(device) for device_{lock,unlock} flows

From: Ira Weiny
Date: Tue Dec 12 2023 - 14:56:52 EST


Vishal Verma wrote:
> Introduce a guard(device) macro to lock a 'struct device', and unlock it
> automatically when going out of scope using Scope Based Resource
> Management semantics. A lot of the sysfs attribute writes in
> drivers/dax/bus.c benefit from a cleanup using these, so change these
> where applicable.
>
> Cc: Joao Martins <joao.m.martins@xxxxxxxxxx>
> Suggested-by: Dan Williams <dan.j.williams@xxxxxxxxx>
> Signed-off-by: Vishal Verma <vishal.l.verma@xxxxxxxxx>
>

Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>