Merge branch 'for-linus-1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[firefly-linux-kernel-4.4.55.git] / include / linux / device.h
index 0eb8ee2dc6d1d7dcc50c9284d3bac4f60d1f4f74..f3f2c7e38060245e8e40df56d9d924168c795abd 100644 (file)
@@ -916,6 +916,13 @@ static inline void device_lock_assert(struct device *dev)
        lockdep_assert_held(&dev->mutex);
 }
 
+static inline struct device_node *dev_of_node(struct device *dev)
+{
+       if (!IS_ENABLED(CONFIG_OF))
+               return NULL;
+       return dev->of_node;
+}
+
 void driver_init(void);
 
 /*