diff --git a/include/linux/device.h b/include/linux/device.h index 0eb8ee2dc6d1..f3f2c7e38060 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -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); /*