Skip to contentSkip to conversation

ARM: socfpga: Explicitly include correct DT includes

PATCH Applied Rob Herring 2 participants 4 messages Jul 17, 2023 – Aug 23, 2023

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

PATCH 1/1 ARM: socfpga: 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 was 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.

A couple of other includes are unused and can be dropped too.

---
 arch/arm/mach-socfpga/l2_cache.c | 2 +-
 arch/arm/mach-socfpga/ocram.c    | 4 +---
 arch/arm/mach-socfpga/pm.c       | 2 ++
 arch/arm/mach-socfpga/socfpga.c  | 4 +---
 4 files changed, 5 insertions(+), 7 deletions(-)
arch/arm/mach-socfpga/l2_cache.c +1 -1
index 99fb95361590..86e011eeb444 100644
@@ -3,7 +3,7 @@
  * Copyright Altera Corporation (C) 2016. All rights reserved.
  */
 #include <linux/io.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 
 #include "core.h"
arch/arm/mach-socfpga/ocram.c +1 -3
index b4d397e834a0..9f1a249debf6 100644
@@ -4,10 +4,8 @@
  */
 #include <linux/delay.h>
 #include <linux/io.h>
-#include <linux/genalloc.h>
-#include <linux/module.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_platform.h>
 
 #include "core.h"
 
arch/arm/mach-socfpga/pm.c +2 -0
index 365c0428b21b..ab1c08f971f0 100644
@@ -13,7 +13,9 @@
 #include <linux/genalloc.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/platform_device.h>
 #include <linux/suspend.h>
 #include <asm/suspend.h>
 #include <asm/fncpy.h>
arch/arm/mach-socfpga/socfpga.c +1 -3
index 9e4cb2ffd580..4332af2d8b86 100644
@@ -3,13 +3,11 @@
  *  Copyright (C) 2012-2015 Altera Corporation
  */
 #include <linux/irqchip.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/of_platform.h>
 #include <linux/reboot.h>
 #include <linux/reset/socfpga.h>
 
-#include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/cacheflush.h>
Signature · 1 line
2.40.1
maintainer Applied
#1 lore raw
Quoted 9 lines · Rob Herring

The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was 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.

Applied!

Thanks,
Dinh

#2 lore raw
Quoted 14 lines · Dinh Nguyen
Quoted 9 lines · Rob Herring

The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was 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.

Quoted 1 line

Applied!

Did you really? Doesn't look like this is in linux-next.

Rob

maintainer
#3 lore raw
Quoted 15 lines · Rob Herring
Quoted 14 lines · Dinh Nguyen
Quoted 9 lines · Rob Herring

The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was 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.

Quoted 3 lines
Quoted 1 line

Applied!

Did you really? Doesn't look like this is in linux-next.

I did, but haven't sent a PR to armsoc. Will do it now, thanks for the reminder!

Dinh