Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

+5 -7
+5 -7
include/linux/of_device.h
··· 1 1 #ifndef _LINUX_OF_DEVICE_H 2 2 #define _LINUX_OF_DEVICE_H 3 3 4 - #ifdef CONFIG_OF_DEVICE 5 - #include <linux/device.h> 6 - #include <linux/platform_device.h> 7 - #include <linux/of.h> 8 - #include <linux/mod_devicetable.h> 9 - 10 - 11 4 /* 12 5 * The of_device *was* a kind of "base class" that was a superset of 13 6 * struct device for use by devices attached to an OF node and probed ··· 15 22 * from the kernel. 16 23 */ 17 24 #define of_device platform_device 25 + #include <linux/platform_device.h> 18 26 27 + #ifdef CONFIG_OF_DEVICE 28 + #include <linux/device.h> 29 + #include <linux/of.h> 30 + #include <linux/mod_devicetable.h> 19 31 #include <asm/of_device.h> 20 32 21 33 #define to_of_device(d) container_of(d, struct of_device, dev)