diff mbox series

of_device: removed #include that caused a recursion in included headers

Message ID 1586784960-22692-1-git-send-email-hadar.gat@arm.com (mailing list archive)
State New, archived
Headers show
Series of_device: removed #include that caused a recursion in included headers | expand

Commit Message

Hadar Gat April 13, 2020, 1:35 p.m. UTC
Both of_platform.h and of_device.h were included each other.
In of_device.h, removed unneeded #include to of_platform.h
and added include to of_platform.h in the files that needs it.

Signed-off-by: Hadar Gat <hadar.gat@arm.com>
---
 drivers/base/platform.c                           | 1 +
 drivers/bus/vexpress-config.c                     | 1 +
 drivers/dma/at_hdmac.c                            | 1 +
 drivers/dma/stm32-dmamux.c                        | 1 +
 drivers/dma/ti/dma-crossbar.c                     | 1 +
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c             | 1 +
 drivers/gpu/drm/msm/hdmi/hdmi.c                   | 1 +
 drivers/gpu/drm/msm/msm_drv.c                     | 1 +
 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   | 1 +
 drivers/gpu/drm/sun4i/sun4i_tcon.c                | 1 +
 drivers/iio/adc/stm32-adc-core.c                  | 1 +
 drivers/iio/adc/stm32-dfsdm-adc.c                 | 1 +
 drivers/iio/adc/stm32-dfsdm-core.c                | 1 +
 drivers/iommu/tegra-smmu.c                        | 1 +
 drivers/memory/atmel-ebi.c                        | 1 +
 drivers/mfd/palmas.c                              | 1 +
 drivers/mfd/ssbi.c                                | 1 +
 drivers/mtd/nand/raw/omap2.c                      | 1 +
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 +
 drivers/net/ethernet/ti/cpsw.c                    | 1 +
 drivers/phy/tegra/xusb.c                          | 1 +
 drivers/pinctrl/nomadik/pinctrl-nomadik.c         | 1 +
 drivers/soc/samsung/exynos-pmu.c                  | 1 +
 drivers/soc/sunxi/sunxi_sram.c                    | 1 +
 include/linux/of_device.h                         | 2 --
 lib/genalloc.c                                    | 1 +
 26 files changed, 25 insertions(+), 2 deletions(-)

Comments

kernel test robot April 13, 2020, 10:45 p.m. UTC | #1
Hi Hadar,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on stm32/stm32-next]
[also build test ERROR on sunxi/sunxi/for-next tegra/for-next linus/master v5.7-rc1 next-20200413]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Hadar-Gat/of_device-removed-include-that-caused-a-recursion-in-included-headers/20200414-032638
base:   https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
config: x86_64-randconfig-h003-20200413 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 8e2daa0c7f27b5d13b11bff68ae3cd42329abd6c)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/clk/mediatek/clk-mt7622-aud.c:153:6: error: implicit declaration of function 'devm_of_platform_populate' [-Werror,-Wimplicit-function-declaration]
           r = devm_of_platform_populate(&pdev->dev);
               ^
   1 error generated.

vim +/devm_of_platform_populate +153 drivers/clk/mediatek/clk-mt7622-aud.c

2fc0a509e4ee85 Sean Wang 2017-10-05  132  
2fc0a509e4ee85 Sean Wang 2017-10-05  133  static int clk_mt7622_audiosys_init(struct platform_device *pdev)
2fc0a509e4ee85 Sean Wang 2017-10-05  134  {
2fc0a509e4ee85 Sean Wang 2017-10-05  135  	struct clk_onecell_data *clk_data;
2fc0a509e4ee85 Sean Wang 2017-10-05  136  	struct device_node *node = pdev->dev.of_node;
2fc0a509e4ee85 Sean Wang 2017-10-05  137  	int r;
2fc0a509e4ee85 Sean Wang 2017-10-05  138  
2fc0a509e4ee85 Sean Wang 2017-10-05  139  	clk_data = mtk_alloc_clk_data(CLK_AUDIO_NR_CLK);
2fc0a509e4ee85 Sean Wang 2017-10-05  140  
2fc0a509e4ee85 Sean Wang 2017-10-05  141  	mtk_clk_register_gates(node, audio_clks, ARRAY_SIZE(audio_clks),
2fc0a509e4ee85 Sean Wang 2017-10-05  142  			       clk_data);
2fc0a509e4ee85 Sean Wang 2017-10-05  143  
2fc0a509e4ee85 Sean Wang 2017-10-05  144  	r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
037b21133e5367 Ryder Lee 2018-03-20  145  	if (r) {
2fc0a509e4ee85 Sean Wang 2017-10-05  146  		dev_err(&pdev->dev,
2fc0a509e4ee85 Sean Wang 2017-10-05  147  			"could not register clock provider: %s: %d\n",
2fc0a509e4ee85 Sean Wang 2017-10-05  148  			pdev->name, r);
2fc0a509e4ee85 Sean Wang 2017-10-05  149  
037b21133e5367 Ryder Lee 2018-03-20  150  		goto err_clk_provider;
037b21133e5367 Ryder Lee 2018-03-20  151  	}
037b21133e5367 Ryder Lee 2018-03-20  152  
037b21133e5367 Ryder Lee 2018-03-20 @153  	r = devm_of_platform_populate(&pdev->dev);
037b21133e5367 Ryder Lee 2018-03-20  154  	if (r)
037b21133e5367 Ryder Lee 2018-03-20  155  		goto err_plat_populate;
037b21133e5367 Ryder Lee 2018-03-20  156  
037b21133e5367 Ryder Lee 2018-03-20  157  	return 0;
037b21133e5367 Ryder Lee 2018-03-20  158  
037b21133e5367 Ryder Lee 2018-03-20  159  err_plat_populate:
037b21133e5367 Ryder Lee 2018-03-20  160  	of_clk_del_provider(node);
037b21133e5367 Ryder Lee 2018-03-20  161  err_clk_provider:
2fc0a509e4ee85 Sean Wang 2017-10-05  162  	return r;
2fc0a509e4ee85 Sean Wang 2017-10-05  163  }
2fc0a509e4ee85 Sean Wang 2017-10-05  164  

:::::: The code at line 153 was first introduced by commit
:::::: 037b21133e5367c833908db0226d77138ba4c5eb clk: mediatek: add devm_of_platform_populate() for MT7622 audsys

:::::: TO: Ryder Lee <ryder.lee@mediatek.com>
:::::: CC: Stephen Boyd <sboyd@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot April 13, 2020, 10:56 p.m. UTC | #2
Hi Hadar,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on stm32/stm32-next]
[also build test ERROR on linus/master v5.7-rc1 next-20200413]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Hadar-Gat/of_device-removed-include-that-caused-a-recursion-in-included-headers/20200414-032638
base:   https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
config: sparc-randconfig-a001-20200413 (attached as .config)
compiler: sparc-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=9.3.0 make.cross ARCH=sparc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/sparc/mm/iommu.c: In function 'iommu_init':
>> arch/sparc/mm/iommu.c:139:32: error: implicit declaration of function 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? [-Werror=implicit-function-declaration]
     139 |   struct platform_device *op = of_find_device_by_node(dp);
         |                                ^~~~~~~~~~~~~~~~~~~~~~
         |                                bus_find_device_by_fwnode
>> arch/sparc/mm/iommu.c:139:32: error: initialization of 'struct platform_device *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
   cc1: all warnings being treated as errors
--
   arch/sparc/mm/io-unit.c: In function 'iounit_init':
>> arch/sparc/mm/io-unit.c:81:32: error: implicit declaration of function 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? [-Werror=implicit-function-declaration]
      81 |   struct platform_device *op = of_find_device_by_node(dp);
         |                                ^~~~~~~~~~~~~~~~~~~~~~
         |                                bus_find_device_by_fwnode
>> arch/sparc/mm/io-unit.c:81:32: error: initialization of 'struct platform_device *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
   cc1: all warnings being treated as errors

vim +139 arch/sparc/mm/iommu.c

^1da177e4c3f41 Linus Torvalds  2005-04-16  133  
046e26a8ba10b8 David S. Miller 2008-08-27  134  static int __init iommu_init(void)
046e26a8ba10b8 David S. Miller 2008-08-27  135  {
046e26a8ba10b8 David S. Miller 2008-08-27  136  	struct device_node *dp;
046e26a8ba10b8 David S. Miller 2008-08-27  137  
046e26a8ba10b8 David S. Miller 2008-08-27  138  	for_each_node_by_name(dp, "iommu") {
cd4cd7306a403f Grant Likely    2010-07-22 @139  		struct platform_device *op = of_find_device_by_node(dp);
046e26a8ba10b8 David S. Miller 2008-08-27  140  
046e26a8ba10b8 David S. Miller 2008-08-27  141  		sbus_iommu_init(op);
046e26a8ba10b8 David S. Miller 2008-08-27  142  		of_propagate_archdata(op);
046e26a8ba10b8 David S. Miller 2008-08-27  143  	}
046e26a8ba10b8 David S. Miller 2008-08-27  144  
046e26a8ba10b8 David S. Miller 2008-08-27  145  	return 0;
046e26a8ba10b8 David S. Miller 2008-08-27  146  }
046e26a8ba10b8 David S. Miller 2008-08-27  147  

:::::: The code at line 139 was first introduced by commit
:::::: cd4cd7306a403f62ef3ca783b9d1cf2a03e595ed sparc: remove references to of_device and to_of_device

:::::: TO: Grant Likely <grant.likely@secretlab.ca>
:::::: CC: Grant Likely <grant.likely@secretlab.ca>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot April 13, 2020, 11:02 p.m. UTC | #3
Hi Hadar,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on stm32/stm32-next]
[also build test ERROR on sunxi/sunxi/for-next tegra/for-next linus/master v5.7-rc1 next-20200413]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Hadar-Gat/of_device-removed-include-that-caused-a-recursion-in-included-headers/20200414-032638
base:   https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
config: arm-multi_v5_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=9.3.0 make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/bus/imx-weim.c: In function 'weim_parse_dt':
>> drivers/bus/imx-weim.c:227:9: error: implicit declaration of function 'of_platform_default_populate' [-Werror=implicit-function-declaration]
     227 |   ret = of_platform_default_populate(pdev->dev.of_node,
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   drivers/pinctrl/freescale/pinctrl-imx1-core.c: In function 'imx1_pinctrl_core_probe':
>> drivers/pinctrl/freescale/pinctrl-imx1-core.c:639:8: error: implicit declaration of function 'of_platform_populate' [-Werror=implicit-function-declaration]
     639 |  ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
         |        ^~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/of_platform_default_populate +227 drivers/bus/imx-weim.c

85bf6d4e4b100e Huang Shijie      2013-05-28  189  
4a92f07816ba30 Sascha Hauer      2019-08-14  190  static int weim_parse_dt(struct platform_device *pdev, void __iomem *base)
85bf6d4e4b100e Huang Shijie      2013-05-28  191  {
3f98b6baad63b1 Alexander Shiyan  2013-06-29  192  	const struct of_device_id *of_id = of_match_device(weim_id_table,
3f98b6baad63b1 Alexander Shiyan  2013-06-29  193  							   &pdev->dev);
3f98b6baad63b1 Alexander Shiyan  2013-06-29  194  	const struct imx_weim_devtype *devtype = of_id->data;
85bf6d4e4b100e Huang Shijie      2013-05-28  195  	struct device_node *child;
52c47b63412b09 Alison Chaiken    2015-02-18  196  	int ret, have_child = 0;
c7995bcb36ef61 Sven Van Asbroeck 2018-12-17  197  	struct cs_timing_state ts = {};
77266e722feabb Sven Van Asbroeck 2019-07-12  198  	u32 reg;
85bf6d4e4b100e Huang Shijie      2013-05-28  199  
8d9ee21e98205e Shawn Guo         2014-02-11  200  	if (devtype == &imx50_weim_devtype) {
8d9ee21e98205e Shawn Guo         2014-02-11  201  		ret = imx_weim_gpr_setup(pdev);
8d9ee21e98205e Shawn Guo         2014-02-11  202  		if (ret)
8d9ee21e98205e Shawn Guo         2014-02-11  203  			return ret;
8d9ee21e98205e Shawn Guo         2014-02-11  204  	}
8d9ee21e98205e Shawn Guo         2014-02-11  205  
77266e722feabb Sven Van Asbroeck 2019-07-12  206  	if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) {
77266e722feabb Sven Van Asbroeck 2019-07-12  207  		if (devtype->wcr_bcm) {
77266e722feabb Sven Van Asbroeck 2019-07-12  208  			reg = readl(base + devtype->wcr_offset);
77266e722feabb Sven Van Asbroeck 2019-07-12  209  			writel(reg | devtype->wcr_bcm,
77266e722feabb Sven Van Asbroeck 2019-07-12  210  				base + devtype->wcr_offset);
77266e722feabb Sven Van Asbroeck 2019-07-12  211  		} else {
77266e722feabb Sven Van Asbroeck 2019-07-12  212  			dev_err(&pdev->dev, "burst clk mode not supported.\n");
77266e722feabb Sven Van Asbroeck 2019-07-12  213  			return -EINVAL;
77266e722feabb Sven Van Asbroeck 2019-07-12  214  		}
77266e722feabb Sven Van Asbroeck 2019-07-12  215  	}
77266e722feabb Sven Van Asbroeck 2019-07-12  216  
33b96d2c957921 Fabio Estevam     2016-02-22  217  	for_each_available_child_of_node(pdev->dev.of_node, child) {
c7995bcb36ef61 Sven Van Asbroeck 2018-12-17  218  		ret = weim_timing_setup(&pdev->dev, child, base, devtype, &ts);
52c47b63412b09 Alison Chaiken    2015-02-18  219  		if (ret)
9c0982d809fd81 Rob Herring       2017-07-18  220  			dev_warn(&pdev->dev, "%pOF set timing failed.\n",
9c0982d809fd81 Rob Herring       2017-07-18  221  				child);
52c47b63412b09 Alison Chaiken    2015-02-18  222  		else
52c47b63412b09 Alison Chaiken    2015-02-18  223  			have_child = 1;
85bf6d4e4b100e Huang Shijie      2013-05-28  224  	}
85bf6d4e4b100e Huang Shijie      2013-05-28  225  
52c47b63412b09 Alison Chaiken    2015-02-18  226  	if (have_child)
39ec8d3809fdf5 Kefeng Wang       2016-06-01 @227  		ret = of_platform_default_populate(pdev->dev.of_node,
26651c4376454b Liu Ying          2014-07-04  228  						   NULL, &pdev->dev);
85bf6d4e4b100e Huang Shijie      2013-05-28  229  	if (ret)
9c0982d809fd81 Rob Herring       2017-07-18  230  		dev_err(&pdev->dev, "%pOF fail to create devices.\n",
9c0982d809fd81 Rob Herring       2017-07-18  231  			pdev->dev.of_node);
85bf6d4e4b100e Huang Shijie      2013-05-28  232  	return ret;
85bf6d4e4b100e Huang Shijie      2013-05-28  233  }
85bf6d4e4b100e Huang Shijie      2013-05-28  234  

:::::: The code at line 227 was first introduced by commit
:::::: 39ec8d3809fdf5228f9cb9fa3d3f2bfb4ee57956 bus: imx-weim: use of_platform_default_populate() to populate default bus

:::::: TO: Kefeng Wang <wangkefeng.wang@huawei.com>
:::::: CC: Rob Herring <robh@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 5255550..f549274b 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -12,6 +12,7 @@ 
 #include <linux/string.h>
 #include <linux/platform_device.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/of_irq.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index ff70575..12b8b0b 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -8,6 +8,7 @@ 
 #include <linux/init.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/vexpress.h>
 
 
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 672c73b..51337b4 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -20,6 +20,7 @@ 
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/of_dma.h>
 
 #include "at_hdmac_regs.h"
diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c
index 3c89bd3..74695b9 100644
--- a/drivers/dma/stm32-dmamux.c
+++ b/drivers/dma/stm32-dmamux.c
@@ -16,6 +16,7 @@ 
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/of_dma.h>
 #include <linux/pm_runtime.h>
 #include <linux/reset.h>
diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c
index f255056..10c6d23 100644
--- a/drivers/dma/ti/dma-crossbar.c
+++ b/drivers/dma/ti/dma-crossbar.c
@@ -10,6 +10,7 @@ 
 #include <linux/io.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/of_dma.h>
 
 #define TI_XBAR_DRA7		0
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index c4e71ab..f523254 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -6,6 +6,7 @@ 
 #include <linux/interconnect.h>
 #include <linux/pm_domain.h>
 #include <linux/pm_opp.h>
+#include <linux/of_platform.h>
 #include <soc/qcom/cmd-db.h>
 
 #include "a6xx_gpu.h"
diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c
index 737453b..5034d40 100644
--- a/drivers/gpu/drm/msm/hdmi/hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi/hdmi.c
@@ -7,6 +7,7 @@ 
 
 #include <linux/of_irq.h>
 #include <linux/of_gpio.h>
+#include <linux/of_platform.h>
 
 #include <sound/hdmi-codec.h>
 #include "hdmi.h"
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 29295de..ddc9e85 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -8,6 +8,7 @@ 
 #include <linux/dma-mapping.h>
 #include <linux/kthread.h>
 #include <linux/uaccess.h>
+#include <linux/of_platform.h>
 #include <uapi/linux/sched/types.h>
 
 #include <drm/drm_drv.h>
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 6e1270e..d038bae 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -12,6 +12,7 @@ 
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/phy/phy.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
index 624437b..aa35757 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
@@ -11,6 +11,7 @@ 
 #include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/of_irq.h>
 #include <linux/regmap.h>
 #include <linux/reset.h>
diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
index 2df88d2..3dc3453 100644
--- a/drivers/iio/adc/stm32-adc-core.c
+++ b/drivers/iio/adc/stm32-adc-core.c
@@ -17,6 +17,7 @@ 
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index 76a60d9..e83848cb 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -20,6 +20,7 @@ 
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
index 26e2011..f6a53ab 100644
--- a/drivers/iio/adc/stm32-dfsdm-core.c
+++ b/drivers/iio/adc/stm32-dfsdm-core.c
@@ -12,6 +12,7 @@ 
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/pinctrl/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 63a147b..3797caa 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -10,6 +10,7 @@ 
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index 14386d0..272b1a8 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -13,6 +13,7 @@ 
 #include <linux/mfd/syscon/atmel-smc.h>
 #include <linux/init.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/regmap.h>
 #include <soc/at91/atmel-sfr.h>
 
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index f5b3fa9..cca44bc 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -19,6 +19,7 @@ 
 #include <linux/mfd/core.h>
 #include <linux/mfd/palmas.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 
 static const struct regmap_config palmas_regmap_config[PALMAS_NUM_CLIENTS] = {
 	{
diff --git a/drivers/mfd/ssbi.c b/drivers/mfd/ssbi.c
index 94f60df..72cd45a 100644
--- a/drivers/mfd/ssbi.c
+++ b/drivers/mfd/ssbi.c
@@ -20,6 +20,7 @@ 
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 
 /* SSBI 2.0 controller registers */
 #define SSBI2_CMD			0x0008
diff --git a/drivers/mtd/nand/raw/omap2.c b/drivers/mtd/nand/raw/omap2.c
index ad77c11..d851ec7 100644
--- a/drivers/mtd/nand/raw/omap2.c
+++ b/drivers/mtd/nand/raw/omap2.c
@@ -22,6 +22,7 @@ 
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 
 #include <linux/mtd/nand_bch.h>
 #include <linux/platform_data/elm.h>
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 58e0511..d704d57 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -12,6 +12,7 @@ 
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/of_mdio.h>
 #include <linux/of_net.h>
 #include <linux/phy.h>
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c2c5bf8..6932945 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -28,6 +28,7 @@ 
 #include <linux/of_mdio.h>
 #include <linux/of_net.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/if_vlan.h>
 #include <linux/kmemleak.h>
 #include <linux/sys_soc.h>
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index de4a46f..0eac1b8 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -9,6 +9,7 @@ 
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/phy/phy.h>
 #include <linux/phy/tegra/xusb.h>
 #include <linux/platform_device.h>
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index 95f864d..d61ee59 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -19,6 +19,7 @@ 
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/of_address.h>
 #include <linux/bitops.h>
 #include <linux/pinctrl/machine.h>
diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c
index 17304fa..25129b0 100644
--- a/drivers/soc/samsung/exynos-pmu.c
+++ b/drivers/soc/samsung/exynos-pmu.c
@@ -8,6 +8,7 @@ 
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/mfd/syscon.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index 1b0d50f..423cec3 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -16,6 +16,7 @@ 
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 8d31e39..752999b 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -4,8 +4,6 @@ 
 
 #include <linux/cpu.h>
 #include <linux/platform_device.h>
-#include <linux/of_platform.h> /* temporary until merge */
-
 #include <linux/of.h>
 #include <linux/mod_devicetable.h>
 
diff --git a/lib/genalloc.c b/lib/genalloc.c
index 7f1244b..08e21eeb 100644
--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -33,6 +33,7 @@ 
 #include <linux/interrupt.h>
 #include <linux/genalloc.h>
 #include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/vmalloc.h>
 
 static inline size_t chunk_size(const struct gen_pool_chunk *chunk)