Re: [PATCH v2 2/3] PCI: Provide lock guard for pci_rescan_remove_lock
From: Benjamin Block
Date: Fri Mar 13 2026 - 09:50:13 EST
On Thu, Mar 12, 2026 at 08:44:02PM +0100, Niklas Schnelle wrote:
> On Wed, 2026-03-11 at 14:27 +0100, Benjamin Block wrote:
> > Make it possible to use guard() or scoped_guard() to lock, and
> > automatically unlock `pci_rescan_remove_lock`.
> >
> > Since the actual mutex `pci_rescan_remove_lock` is always supposed to be
> > taken and released using the functions pci_lock_rescan_remove() and
> > pci_unlock_rescan_remove() it is not possible to simply use the already
> > existing guards for `struct mutex`. Instead define a new guard
> > `pci_rescan_remove` that will also call the functions in question, but
> > is usable via guard() or scoped_guard().
> >
> > Signed-off-by: Benjamin Block <bblock@xxxxxxxxxxxxx>
> > ---
> > include/linux/pci.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
--8<--
>
> Looks good to me. Thank you.
>
> Reviewed-by: Niklas Schnelle <schnelle@xxxxxxxxxxxxx>
Thanks.
--
Best Regards, Benjamin Block / Linux on IBM Z Kernel Development
IBM Deutschland Research & Development GmbH / https://www.ibm.com/privacy
Vors. Aufs.-R.: Wolfgang Wendt / Geschäftsführung: David Faller
Sitz der Ges.: Ehningen / Registergericht: AmtsG Stuttgart, HRB 243294