Re: [PATCH 1/7] driver core: Add conditional guard support for device_lock()
From: Dan Williams
Date: Tue Mar 10 2026 - 14:41:29 EST
Dave Jiang wrote:
[..]
> >>> 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!
> >
> > Why? It is a single logical change and hence should be a separate patch, no?
>
> For some reason I missed it's in linux/device.h. So sure ok. But
> typically I would like to see the usage if it's in the same
> sub-system.
I generally expect the same as well.
...however, when we get into multiple in flight patch sets wanting the
same API [1] it would be nice to have a stable commit id to share, Greg?
[1]: TEE I/O enabling also has a use case, and introduced the helper
with the "first" user.
http://lore.kernel.org/20260303000207.1836586-7-dan.j.williams@xxxxxxxxx