Skip to contentSkip to conversation

devfreq: imx: Explicitly include correct DT includes

PATCH In review Rob Herring 2 participants 2 messages Jul 14, 2023 – Jul 23, 2023

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

PATCH 1/1 devfreq: imx: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes.

---
 drivers/devfreq/imx-bus.c         | 2 +-
 drivers/devfreq/imx8m-ddrc.c      | 2 +-
 drivers/devfreq/mtk-cci-devfreq.c | 1 -
 drivers/devfreq/tegra30-devfreq.c | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)
drivers/devfreq/imx-bus.c +1 -1
index a727067980fb..86850b7dea09 100644
@@ -7,7 +7,7 @@
 #include <linux/devfreq.h>
 #include <linux/device.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/pm_opp.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
drivers/devfreq/imx8m-ddrc.c +1 -1
index 16636973eb10..e1348490c8aa 100644
@@ -3,9 +3,9 @@
  * Copyright 2019 NXP
  */
 
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/device.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/devfreq.h>
 #include <linux/pm_opp.h>
drivers/devfreq/mtk-cci-devfreq.c +0 -1
index 6354622eda65..83a73f0ccd80 100644
@@ -8,7 +8,6 @@
 #include <linux/minmax.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/regulator/consumer.h>
drivers/devfreq/tegra30-devfreq.c +1 -1
index 503376b894b6..4a4f0106ab9d 100644
@@ -13,7 +13,7 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/reset.h>
Signature · 1 line
2.40.1
#1 lore raw
Quoted 62 lines · Rob Herring

The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes.

---
 drivers/devfreq/imx-bus.c         | 2 +-
 drivers/devfreq/imx8m-ddrc.c      | 2 +-
 drivers/devfreq/mtk-cci-devfreq.c | 1 -
 drivers/devfreq/tegra30-devfreq.c | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)
drivers/devfreq/imx-bus.c +1 -1
index a727067980fb..86850b7dea09 100644
@@ -7,7 +7,7 @@
 #include <linux/devfreq.h>
 #include <linux/device.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/pm_opp.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
drivers/devfreq/imx8m-ddrc.c +1 -1
index 16636973eb10..e1348490c8aa 100644
@@ -3,9 +3,9 @@
  * Copyright 2019 NXP
  */
 
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/device.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/devfreq.h>
 #include <linux/pm_opp.h>
drivers/devfreq/mtk-cci-devfreq.c +0 -1
index 6354622eda65..83a73f0ccd80 100644
@@ -8,7 +8,6 @@
 #include <linux/minmax.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/regulator/consumer.h>
drivers/devfreq/tegra30-devfreq.c +0 -0
index 503376b894b6..4a4f0106ab9d 100644

drivers/devfreq/tegra30-devfreq.c line 19

Quoted 8 lines
drivers/devfreq/tegra30-devfreq.c +1 -1
@@ -13,7 +13,7 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/reset.h>

Looks good to me.
But, need to change the patch title with 'PM / ' prefix to keep the consistency of previous devfreq patch and then this patch touched the other devfreq drivers except for imx drivers.

So that I think that it is better to change the patch title as following and then applied it. Thanks.
- "PM / devfreq: Explicitly include correct DT includes"

Signature · 3 lines
Best Regards,
Samsung Electronics
Chanwoo Choi