Merge branch 'linus' into x86/urgent, to pick up dependent changes
[linux-2.6-microblaze.git] / include / linux / device.h
index 4457e56..e85264f 100644 (file)
@@ -1229,7 +1229,7 @@ static inline void device_lock_assert(struct device *dev)
 
 static inline struct device_node *dev_of_node(struct device *dev)
 {
-       if (!IS_ENABLED(CONFIG_OF))
+       if (!IS_ENABLED(CONFIG_OF) || !dev)
                return NULL;
        return dev->of_node;
 }