Re: [PATCH 1/7] driver core: Add conditional guard support for device_lock()
From: Dave Jiang
Date: Tue Mar 10 2026 - 13:45:24 EST
On 3/10/26 8:57 AM, Li Ming wrote:
> Introduce conditional guard version of device_lock() for scenarios that
> require conditional device lock holding.
>
> Suggested-by: Dan Williams <dan.j.williams@xxxxxxxxx>
> Signed-off-by: Li Ming <ming.li@xxxxxxxxxxxx>
> ---
> include/linux/device.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 0be95294b6e6..4fafee80524b 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -911,6 +911,7 @@ static inline void device_unlock(struct device *dev)
> }
>
> DEFINE_GUARD(device, struct device *, device_lock(_T), device_unlock(_T))
> +DEFINE_GUARD_COND(device, _intr, device_lock_interruptible(_T), _RET == 0)
Can you please just squash this small change to the same patch that is using it? Thanks!
>
> static inline void device_lock_assert(struct device *dev)
> {
>