driver core: Add a guard() definition for the device_lock()
[linux-2.6-microblaze.git] / include / linux / device.h
index d7a72a8..6c83294 100644 (file)
@@ -1007,6 +1007,8 @@ static inline void device_unlock(struct device *dev)
        mutex_unlock(&dev->mutex);
 }
 
+DEFINE_GUARD(device, struct device *, device_lock(_T), device_unlock(_T))
+
 static inline void device_lock_assert(struct device *dev)
 {
        lockdep_assert_held(&dev->mutex);