Skip to contentSkip to conversation

iommu: Explicitly include correct DT includes

PATCH Applied Rob Herring 3 participants 3 messages Jul 14, 2023 – Aug 7, 2023

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

PATCH 1/1 iommu: 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/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c | 2 +-
 drivers/iommu/arm/arm-smmu/arm-smmu.c            | 1 -
 drivers/iommu/arm/arm-smmu/qcom_iommu.c          | 3 +--
 drivers/iommu/ipmmu-vmsa.c                       | 1 -
 drivers/iommu/sprd-iommu.c                       | 1 +
 drivers/iommu/tegra-smmu.c                       | 2 +-
 drivers/iommu/virtio-iommu.c                     | 2 +-
 7 files changed, 5 insertions(+), 7 deletions(-)
drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c +1 -1
index b5b14108e086..bb89d49adf8d 100644
@@ -3,7 +3,7 @@
  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
-#include <linux/of_device.h>
+#include <linux/device.h>
 #include <linux/firmware/qcom/qcom_scm.h>
 #include <linux/ratelimit.h>
 
drivers/iommu/arm/arm-smmu/arm-smmu.c +0 -1
index a86acd76c1df..d6d1a2a55cc0 100644
@@ -29,7 +29,6 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
drivers/iommu/arm/arm-smmu/qcom_iommu.c +1 -2
index a503ed758ec3..cc3f68a3516c 100644
@@ -22,8 +22,7 @@
 #include <linux/init.h>
 #include <linux/mutex.h>
 #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/pm.h>
 #include <linux/pm_runtime.h>
drivers/iommu/ipmmu-vmsa.c +0 -1
index 9f64c5c9f5b9..0aeedd3e1494 100644
@@ -17,7 +17,6 @@
 #include <linux/io-pgtable.h>
 #include <linux/iommu.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/sizes.h>
drivers/iommu/sprd-iommu.c +1 -0
index 39e34fdeccda..51144c232474 100644
@@ -14,6 +14,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
 
drivers/iommu/tegra-smmu.c +1 -1
index 1cbf063ccf14..e445f80d0226 100644
@@ -9,7 +9,7 @@
 #include <linux/iommu.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
drivers/iommu/virtio-iommu.c +1 -1
index 3551ed057774..17dcd826f5c2 100644
@@ -13,7 +13,7 @@
 #include <linux/interval_tree.h>
 #include <linux/iommu.h>
 #include <linux/module.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/pci.h>
 #include <linux/virtio.h>
 #include <linux/virtio_config.h>
Signature · 1 line
2.40.1
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 8 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.

Thanks Rob; FWIW,

I guess you're hoping for Joerg to pick this up? However I wouldn't foresee any major conflicts if you do need to take it through the OF tree.

Cheers,
Robin.

Quoted 100 lines
---
  drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c | 2 +-
  drivers/iommu/arm/arm-smmu/arm-smmu.c            | 1 -
  drivers/iommu/arm/arm-smmu/qcom_iommu.c          | 3 +--
  drivers/iommu/ipmmu-vmsa.c                       | 1 -
  drivers/iommu/sprd-iommu.c                       | 1 +
  drivers/iommu/tegra-smmu.c                       | 2 +-
  drivers/iommu/virtio-iommu.c                     | 2 +-
  7 files changed, 5 insertions(+), 7 deletions(-)
drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c +1 -1
index b5b14108e086..bb89d49adf8d 100644
@@ -3,7 +3,7 @@
   * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
   */
 
-#include <linux/of_device.h>
+#include <linux/device.h>
  #include <linux/firmware/qcom/qcom_scm.h>
  #include <linux/ratelimit.h>
 
drivers/iommu/arm/arm-smmu/arm-smmu.c +0 -1
index a86acd76c1df..d6d1a2a55cc0 100644
@@ -29,7 +29,6 @@
  #include <linux/module.h>
  #include <linux/of.h>
  #include <linux/of_address.h>
-#include <linux/of_device.h>
  #include <linux/pci.h>
  #include <linux/platform_device.h>
  #include <linux/pm_runtime.h>
drivers/iommu/arm/arm-smmu/qcom_iommu.c +1 -2
index a503ed758ec3..cc3f68a3516c 100644
@@ -22,8 +22,7 @@
  #include <linux/init.h>
  #include <linux/mutex.h>
  #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/pm.h>
  #include <linux/pm_runtime.h>
drivers/iommu/ipmmu-vmsa.c +0 -1
index 9f64c5c9f5b9..0aeedd3e1494 100644
@@ -17,7 +17,6 @@
  #include <linux/io-pgtable.h>
  #include <linux/iommu.h>
  #include <linux/of.h>
-#include <linux/of_device.h>
  #include <linux/of_platform.h>
  #include <linux/platform_device.h>
  #include <linux/sizes.h>
drivers/iommu/sprd-iommu.c +1 -0
index 39e34fdeccda..51144c232474 100644
@@ -14,6 +14,7 @@
  #include <linux/mfd/syscon.h>
  #include <linux/module.h>
  #include <linux/of_platform.h>
+#include <linux/platform_device.h>
  #include <linux/regmap.h>
  #include <linux/slab.h>
 
drivers/iommu/tegra-smmu.c +1 -1
index 1cbf063ccf14..e445f80d0226 100644
@@ -9,7 +9,7 @@
  #include <linux/iommu.h>
  #include <linux/kernel.h>
  #include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/of_platform.h>
  #include <linux/pci.h>
  #include <linux/platform_device.h>
  #include <linux/slab.h>
drivers/iommu/virtio-iommu.c +1 -1
index 3551ed057774..17dcd826f5c2 100644
@@ -13,7 +13,7 @@
  #include <linux/interval_tree.h>
  #include <linux/iommu.h>
  #include <linux/module.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
  #include <linux/pci.h>
  #include <linux/virtio.h>
  #include <linux/virtio_config.h>
maintainer Applied
#2 lore raw
In reply to Rob Herring
Quoted 8 lines · Rob Herring
 drivers/iommu/arm/arm-smmu/arm-smmu-qcom-debug.c | 2 +-
 drivers/iommu/arm/arm-smmu/arm-smmu.c            | 1 -
 drivers/iommu/arm/arm-smmu/qcom_iommu.c          | 3 +--
 drivers/iommu/ipmmu-vmsa.c                       | 1 -
 drivers/iommu/sprd-iommu.c                       | 1 +
 drivers/iommu/tegra-smmu.c                       | 2 +-
 drivers/iommu/virtio-iommu.c                     | 2 +-
 7 files changed, 5 insertions(+), 7 deletions(-)

Applied, thanks.