Skip to contentSkip to conversation

of/device: Move struct of_device define outside of CONFIG_OF_DEVICE test

PATCH In review Grant Likely 2 participants 2 messages Jun 10, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of/device: Move struct of_device define outside of CONFIG_OF_DEVICE test

Some code uses of_device even when CONFIG_OF_DEVICE is not set. This patch makes of_device valid all the time by moving it outside of the ifdef CONFIG_OF_DEVICE test.

---

Hi Randy,

Here's what I applied to my tree to fix the niu driver compile warning. I've compile tested it on several architectures, and am pushing it out to my linux-next branch now.

g.

 include/linux/of_device.h |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
include/linux/of_device.h +5 -7
index c877d54..8cd1fe7 100644
@@ -1,13 +1,6 @@
 #ifndef _LINUX_OF_DEVICE_H
 #define _LINUX_OF_DEVICE_H
 
-#ifdef CONFIG_OF_DEVICE
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/of.h>
-#include <linux/mod_devicetable.h>
-
-
 /*
  * The of_device *was* a kind of "base class" that was a superset of
  * struct device for use by devices attached to an OF node and probed
@@ -22,7 +15,12 @@
  * from the kernel.
  */
 #define of_device platform_device
+#include <linux/platform_device.h>
 
+#ifdef CONFIG_OF_DEVICE
+#include <linux/device.h>
+#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <asm/of_device.h>
 
 #define	to_of_device(d) container_of(d, struct of_device, dev)
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Grant Likely

Some code uses of_device even when CONFIG_OF_DEVICE is not set. This patch makes of_device valid all the time by moving it outside of the ifdef CONFIG_OF_DEVICE test.

Quoted 7 lines

---

Hi Randy,

Here's what I applied to my tree to fix the niu driver compile warning. I've compile tested it on several architectures, and am pushing it out to my linux-next branch now.

along with the niu.c patch, of course.

Quoted 37 lines

g.

 include/linux/of_device.h |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
include/linux/of_device.h +5 -7
index c877d54..8cd1fe7 100644
@@ -1,13 +1,6 @@
 #ifndef _LINUX_OF_DEVICE_H
 #define _LINUX_OF_DEVICE_H
 
-#ifdef CONFIG_OF_DEVICE
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/of.h>
-#include <linux/mod_devicetable.h>
-
-
 /*
  * The of_device *was* a kind of "base class" that was a superset of
  * struct device for use by devices attached to an OF node and probed
@@ -22,7 +15,12 @@
  * from the kernel.
  */
 #define of_device platform_device
+#include <linux/platform_device.h>
 
+#ifdef CONFIG_OF_DEVICE
+#include <linux/device.h>
+#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 #include <asm/of_device.h>
 
 #define	to_of_device(d) container_of(d, struct of_device, dev)
Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***