Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac801022 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk Committed by David Vrabel
Browse files

driver core: Provide an wrapper around the mutex to do lockdep warnings



Instead of open-coding it in drivers that want to double check
that their functions are indeed holding the device lock.

Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Suggested-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent e8801a74
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -278,7 +278,7 @@ void pcistub_put_pci_dev(struct pci_dev *dev)
	/* Cleanup our device
	 * (so it's ready for the next domain)
	 */
	lockdep_assert_held(&dev->dev.mutex);
	device_lock_assert(&dev->dev);
	__pci_reset_function_locked(dev);
	pci_restore_state(dev);

+5 −0
Original line number Diff line number Diff line
@@ -911,6 +911,11 @@ static inline void device_unlock(struct device *dev)
	mutex_unlock(&dev->mutex);
}

static inline void device_lock_assert(struct device *dev)
{
	lockdep_assert_held(&dev->mutex);
}

void driver_init(void);

/*