Commit d450f445 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by Rob Herring

<linux/of_platform.h>: fix compilation warnings with DT disabled

Fix the following compilation warnings (in Simon Horman's renesas.git repo):

In file included from arch/arm/mach-shmobile/setup-r8a7779.c:24:0:
include/linux/of_platform.h:107:13: warning: ‘struct of_device_id’ declared
inside parameter list [enabled by default]
include/linux/of_platform.h:107:13: warning: its scope is only this definition
or declaration, which is probably not what you want [enabled by default]
include/linux/of_platform.h:107:13: warning: ‘struct device_node’ declared
inside parameter list [enabled by default]

<linux/of_platform.h> only #include's headers with definitions of the above
mentioned structures if CONFIG_OF_DEVICE=y but uses them even if not. One
solution is to move some #include's out of #ifdef CONFIG_OF_DEVICE and use
incomplete declarations for the rest of the structures where the #ifdef move
doesn't help...
Reported-by: default avatarVladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
parent f6161aa1
......@@ -11,9 +11,10 @@
*
*/
#ifdef CONFIG_OF_DEVICE
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#ifdef CONFIG_OF_DEVICE
#include <linux/pm.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
......@@ -100,7 +101,7 @@ extern int of_platform_populate(struct device_node *root,
#if !defined(CONFIG_OF_ADDRESS)
struct of_dev_auxdata;
struct device;
struct device_node;
static inline int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
const struct of_dev_auxdata *lookup,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment