DT header disentangling, part 1
Subsystems (23)
Rob Herring
maintainercover DT header disentangling, part 1
This is the first of a series of clean-ups to disentangle the DT includes. There's a decade plus old comment in of_device.h:
#include <linux/of_platform.h> /* temporary until merge */
Who's this Grant person that wrote this? ;)
It gets better. of_device.h also pulls in of.h, and of_platform.h includes of_device.h. So naturally, drivers include all combinations of those 3 headers and sometimes they actually need them.
I started on fixing this years ago, but just dropping the circular includes and fixing all the fallout was massive and didn't sit well. Pulling in of_device.h in all the drivers that happen to call only of_device_get_match_data/of_match_device didn't seem great when the rest of of_device.h would never be needed. of_device.h being everything that works on a struct device is not a great split because several types of users deal with struct device. The better split seems to be by user (subsys driver vs. consumer) which several subsystems now do. For of_device.h, the users can primarily be split between bus implementations and device drivers. Device drivers also typically need of.h to read properties. So let's move of_device.h towards just bus related functions and move device driver related functions to of.h.
This series is just the first step. It makes a couple of clean-ups to replace some includes with forward declarations. It moves of_device_get_match_data() and of_cpu_device_node_get() to of.h. The former move is transparent for now and preparation for the next series. The last part of the series updates drivers using of_cpu_device_node_get() and/or relying on the implicit cpu.h include which is removed in the last patch.
---
Rob Herring (19):
of: Make devtree_lock declaration private
of: Move of_device_(add|register|unregister) to of_platform.h
of: Move of_device_get_match_data() declaration
of: Move CPU node related functions to their own file
of: Drop unnecessary includes in headers
ARM: sunxi: Drop of_device.h include
ARM: cpuidle: Drop of_device.h include
riscv: Add explicit include for cpu.h
riscv: cacheinfo: Adjust includes to remove of_device.h
cacheinfo: Adjust includes to remove of_device.h
clocksource: ingenic: Add explicit include for cpuhotplug.h
thermal: cpuidle_cooling: Adjust includes to remove of_device.h
soc: mediatek: mtk-svs: Add explicit include for cpu.h
cpufreq: Adjust includes to remove of_device.h
cpufreq: sun50i: Add explicit include for cpu.h
cpuidle: Adjust includes to remove of_device.h
irqchip: loongson-eiointc: Add explicit include for cpuhotplug.h
OPP: Adjust includes to remove of_device.h
of: Drop cpu.h include from of_device.h
arch/arm/kernel/cpuidle.c | 1 - arch/arm/mach-sunxi/mc_smp.c | 1 - arch/riscv/kernel/cacheinfo.c | 1 - arch/riscv/kernel/setup.c | 2 +- arch/sparc/include/asm/prom.h | 3 + drivers/base/cacheinfo.c | 2 +- drivers/clocksource/ingenic-timer.c | 3 +- drivers/cpufreq/cpufreq-dt-platdev.c | 1 - drivers/cpufreq/kirkwood-cpufreq.c | 2 +- drivers/cpufreq/maple-cpufreq.c | 2 +- drivers/cpufreq/pmac32-cpufreq.c | 2 +- drivers/cpufreq/pmac64-cpufreq.c | 2 +- drivers/cpufreq/qcom-cpufreq-hw.c | 4 +- drivers/cpufreq/spear-cpufreq.c | 2 +- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 3 +- drivers/cpufreq/tegra124-cpufreq.c | 1 - drivers/cpufreq/tegra20-cpufreq.c | 2 +- drivers/cpuidle/cpuidle-psci.c | 1 - drivers/cpuidle/cpuidle-qcom-spm.c | 3 +- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/cpuidle/dt_idle_states.c | 1 - drivers/irqchip/irq-loongson-eiointc.c | 5 +- drivers/of/Makefile | 2 +- drivers/of/base.c | 187 ----------------------------- drivers/of/cpu.c | 210 +++++++++++++++++++++++++++++++++ drivers/of/of_private.h | 1 + drivers/opp/of.c | 2 +- drivers/soc/mediatek/mtk-svs.c | 1 + drivers/thermal/cpuidle_cooling.c | 3 +- include/linux/cpufreq.h | 1 - include/linux/of.h | 28 +++-- include/linux/of_device.h | 24 +--- include/linux/of_platform.h | 10 +- 33 files changed, 261 insertions(+), 254 deletions(-)
---
base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
change-id: 20230329-dt-cpu-header-cleanups-c7bed8c0b352
Best regards,
Signature · 1 line
Rob Herring <[email protected]>
Rob Herring
maintainerPATCH 1/19 of: Make devtree_lock declaration private
Sparc is the only place devtree_lock is used outside of drivers/of/. Move the devtree_lock declaration into of_private.h and Sparc's prom.h so pulling in spinlock.h to of.h can be avoided for everything besides Sparc.
--- arch/sparc/include/asm/prom.h | 3 +++ drivers/of/of_private.h | 1 + include/linux/of.h | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-)
arch/sparc/include/asm/prom.h +3 -0
@@ -19,11 +19,14 @@#include <linux/mutex.h> #include <linux/atomic.h> #include <linux/irqdomain.h> +#include <linux/spinlock.h> #define of_compat_cmp (s1, s2, l) strncmp((s1), (s2), (l))#define of_prop_cmp (s1, s2) strcasecmp((s1), (s2))#define of_node_cmp (s1, s2) strcmp((s1), (s2)) +extern raw_spinlock_t devtree_lock; +struct of_irq_controller {unsigned int (*irq_build)(struct device_node *,unsigned int ,void *);void *data;
drivers/of/of_private.h +1 -0
@@ -38,6 +38,7 @@ struct alias_prop {#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1extern struct mutex of_mutex; +extern raw_spinlock_t devtree_lock;extern struct list_head aliases_lookup;extern struct kset *of_kset;
include/linux/of.h +0 -2
@@ -16,7 +16,6 @@#include <linux/errno.h> #include <linux/kobject.h> #include <linux/mod_devicetable.h> -#include <linux/spinlock.h> #include <linux/topology.h> #include <linux/notifier.h> #include <linux/property.h>
@@ -145,7 +144,6 @@ extern struct device_node *of_root;extern struct device_node *of_chosen;extern struct device_node *of_aliases;extern struct device_node *of_stdout; -extern raw_spinlock_t devtree_lock;/* * struct device_node flag descriptions
Signature · 1 line
2.39.2
Rob Herring
maintainerPATCH 2/19 of: Move of_device_(add|register|unregister) to of_platform.h
In reply to Rob HerringAs of_device_(add|register|unregister) functions work on struct platform_device, they should be declared in of_platform.h instead.
This move is transparent for now as both headers include each other.
--- include/linux/of_device.h | 4 ---- include/linux/of_platform.h | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-)
include/linux/of_device.h +0 -4
@@ -26,10 +26,6 @@ static inline int of_driver_match_device(struct device *dev,return of_match_device (drv->of_match_table, dev) !=NULL ; } -extern int of_device_add (struct platform_device *pdev); -extern int of_device_register (struct platform_device *ofdev); -extern void of_device_unregister (struct platform_device *ofdev); -extern const void *of_device_get_match_data (const struct device *dev);extern ssize_t of_device_modalias (struct device *dev,char *str,ssize_t len);
include/linux/of_platform.h +5 -0
@@ -52,6 +52,11 @@ extern const struct of_device_id of_default_bus_match_table[];extern struct platform_device *of_device_alloc (struct device_node *np,const char *bus_id,struct device *parent); + +extern int of_device_add (struct platform_device *pdev); +extern int of_device_register (struct platform_device *ofdev); +extern void of_device_unregister (struct platform_device *ofdev); +#ifdef CONFIG_OF extern struct platform_device *of_find_device_by_node (struct device_node *np);#else
Signature · 1 line
2.39.2
Rob Herring
maintainerPATCH 3/19 of: Move of_device_get_match_data() declaration
In reply to Rob Herringof_device.h mostly defines functions for bus drivers whereas of_device_get_match_data() is used by drivers. Let's move it to of.h.
--- include/linux/of.h | 2 ++ include/linux/of_device.h | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/of.h +2 -0
@@ -416,6 +416,8 @@ extern int of_detach_node(struct device_node *);#define of_match_ptr (_ptr) (_ptr) +extern const void *of_device_get_match_data (const struct device *dev); +/* * struct property *prop; * const __be32 *p;
include/linux/of_device.h +0 -2
@@ -26,8 +26,6 @@ static inline int of_driver_match_device(struct device *dev,return of_match_device (drv->of_match_table, dev) !=NULL ; } -extern const void *of_device_get_match_data (const struct device *dev); -extern ssize_t of_device_modalias (struct device *dev,char *str,ssize_t len);extern int of_device_request_module (struct device *dev);
Signature · 1 line
2.39.2
Rob Herring
maintainerPATCH 4/19 of: Move CPU node related functions to their own file
In reply to Rob Herringdrivers/of/base.c is quite long and we've accumulated a number of CPU node functions. Let's move them to a new file, cpu.c, along with the lone of_cpu_device_node_get() in of_device.h. Moving the declaration has no effect yet as of.h is included by of_device.h. This serves as preparation to disentangle the includes in of_device.h and of_platform.h.
--- drivers/of/Makefile | 2 +- drivers/of/base.c | 187 ----------------------------------------- drivers/of/cpu.c | 210 ++++++++++++++++++++++++++++++++++++++++++++++ include/linux/of.h | 19 +++-- include/linux/of_device.h | 14 ---- 5 files changed, 223 insertions(+), 209 deletions(-)
drivers/of/Makefile +1 -1
@@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -obj-y = base.o device.o platform.o property.o +obj-y = base.o cpu.o device.o platform.o property.o obj-$(CONFIG_OF_KOBJ) += kobj.o obj-$(CONFIG_OF_DYNAMIC) += dynamic.o obj-$(CONFIG_OF_FLATTREE) += fdt.o
drivers/of/base.c +0 -187
193 lines not on this page · raw message
drivers/of/cpu.c new file +210 -0
210 lines not on this page · raw message
include/linux/of.h +12 -7
@@ -359,6 +359,8 @@ extern const void *of_get_property(const struct device_node *node,const char *name, int *lenp);extern struct device_node *of_get_cpu_node (int cpu,unsigned int *thread); +extern struct device_node *of_cpu_device_node_get (int cpu); +extern int of_cpu_node_to_id (struct device_node *np);extern struct device_node *of_get_next_cpu_node (struct device_node *prev);extern struct device_node *of_get_cpu_state_node (struct device_node *cpu_node,int index);
@@ -439,8 +441,6 @@ const char *of_prop_next_string(struct property *prop, const char *cur);bool of_console_check (struct device_node *dn,char *name,int index); -extern int of_cpu_node_to_id (struct device_node *np); -int of_map_id (struct device_node *np,u32 id,const char *map_name,const char *map_mask_name,struct device_node **target,u32 *id_out);
@@ -635,6 +635,16 @@ static inline struct device_node *of_get_cpu_node(int cpu,return NULL ; } +static inline struct device_node *of_cpu_device_node_get (int cpu) +{ +return NULL ; +} + +static inline int of_cpu_node_to_id (struct device_node *np) +{ +return -ENODEV ; +} +static inline struct device_node *of_get_next_cpu_node (struct device_node *prev) {return NULL ;
@@ -837,11 +847,6 @@ static inline void of_property_clear_flag(struct property *p, unsigned long flag { } -static inline int of_cpu_node_to_id (struct device_node *np) -{ -return -ENODEV ; -} -static inline int of_map_id (struct device_node *np,u32 id,const char *map_name,const char *map_mask_name,struct device_node **target,u32 *id_out)
include/linux/of_device.h +0 -14
@@ -32,15 +32,6 @@ extern int of_device_request_module(struct device *dev);extern void of_device_uevent (const struct device *dev,struct kobj_uevent_env *env);extern int of_device_uevent_modalias (const struct device *dev,struct kobj_uevent_env *env); -static inline struct device_node *of_cpu_device_node_get (int cpu) -{ -struct device *cpu_dev; - cpu_dev =get_cpu_device (cpu); -if (!cpu_dev) -return of_get_cpu_node (cpu,NULL ); -return of_node_get (cpu_dev->of_node); -} -int of_dma_configure_id (struct device *dev,struct device_node *np,bool force_dma,const u32 *id);
@@ -89,11 +80,6 @@ static inline const struct of_device_id *of_match_device(return NULL ; } -static inline struct device_node *of_cpu_device_node_get (int cpu) -{ -return NULL ; -} - static inline int of_dma_configure_id(struct device *dev, struct device_node *np, bool force_dma,
Signature · 1 line
2.39.2
Re: [PATCH 04/19] of: Move CPU node related functions to their own file
Quoted 7 lines · Rob Herring
drivers/of/base.cis quite long and we've accumulated a number of CPU node functions. Let's move them to a new file,cpu.c, along with the loneof_cpu_device_node_get()inof_device.h. Moving the declaration has no effect yet asof.his included byof_device.h. This serves as preparation to disentangle the includes inof_device.handof_platform.h.
Makes sense to have its own file for CPUs, I am sure there will be more additions 😉.
FWIW,
Signature · 2 lines
Regards, Sudeep
Rob Herring
maintainerPATCH 5/19 of: Drop unnecessary includes in headers
In reply to Rob HerringDrop unnecessary includes in DT headers. Some simply aren't needed and some can be replaced with forward declarations.
--- include/linux/of.h | 5 ++--- include/linux/of_device.h | 3 ++- include/linux/of_platform.h | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-)
include/linux/of.h +2 -3
@@ -16,13 +16,10 @@#include <linux/errno.h> #include <linux/kobject.h> #include <linux/mod_devicetable.h> -#include <linux/topology.h> -#include <linux/notifier.h> #include <linux/property.h> #include <linux/list.h> #include <asm/byteorder.h> -#include <asm/errno.h> typedef u32 phandle ;typedef u32 ihandle ;
@@ -1517,6 +1514,8 @@ enum of_reconfig_change { OF_RECONFIG_CHANGE_REMOVE, }; +struct notifier_block ; +#ifdef CONFIG_OF_DYNAMIC extern int of_reconfig_notifier_register (struct notifier_block *);extern int of_reconfig_notifier_unregister (struct notifier_block *);
include/linux/of_device.h +2 -1
@@ -7,9 +7,10 @@#include <linux/of_platform.h> /* temporary until merge */ #include <linux/of.h> -#include <linux/mod_devicetable.h> struct device ; +struct of_device_id ; +struct kobj_uevent_env ;#ifdef CONFIG_OF extern const struct of_device_id *of_match_device(
include/linux/of_platform.h +3 -2
@@ -6,12 +6,13 @@* <[email protected]> */ -#include <linux/device.h> #include <linux/mod_devicetable.h> -#include <linux/pm.h> #include <linux/of_device.h> #include <linux/platform_device.h> +struct device ; +struct of_device_id ; +/** * struct of_dev_auxdata - lookup table entry for device names & platform_data * @compatible: compatible value of node to match against node
Signature · 1 line
2.39.2
Rob Herring
maintainerPATCH 6/19 ARM: sunxi: Drop of_device.h include
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Just drop including of_device.h as of.h is already included.
---
Please ack and I will take the series via the DT tree.
--- arch/arm/mach-sunxi/mc_smp.c | 1 - 1 file changed, 1 deletion(-)
arch/arm/mach-sunxi/mc_smp.c +0 -1
@@ -19,7 +19,6 @@#include <linux/irqchip/arm-gic.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/of_device.h> #include <linux/smp.h> #include <asm/cacheflush.h>
Signature · 1 line
2.39.2
Re: [PATCH 06/19] ARM: sunxi: Drop of_device.h include
Quoted 8 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Just drop includingof_device.hasof.his already included.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
I doubt this file would ever see any more changes.
Quoted 20 lines
--- arch/arm/mach-sunxi/mc_smp.c | 1 - 1 file changed, 1 deletion(-)arch/arm/mach-sunxi/mc_smp.c +0
-2@@ -19,7 +19,6 @@#include <linux/irqchip/arm-gic.h> #include <linux/of.h> #include <linux/of_address.h> -#include <linux/of_device.h> #include <linux/smp.h> #include <asm/cacheflush.h> --2.39.2
Rob Herring
maintainerPATCH 7/19 ARM: cpuidle: Drop of_device.h include
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Just drop including of_device.h as of.h is already included.
---
Please ack and I will take the series via the DT tree.
--- arch/arm/kernel/cpuidle.c | 1 - 1 file changed, 1 deletion(-)
arch/arm/kernel/cpuidle.c +0 -1
@@ -5,7 +5,6 @@#include <linux/cpuidle.h> #include <linux/of.h> -#include <linux/of_device.h> #include <asm/cpuidle.h> extern struct of_cpuidle_method __cpuidle_method_of_table[];
Signature · 1 line
2.39.2
Rob Herring
maintainerPATCH 8/19 riscv: Add explicit include for cpu.h
In reply to Rob HerringRemoving the include of cpu.h from of_device.h (included by of_platform.h) causes an error in setup.c:
arch/riscv/kernel/setup.c:313:22: error: arithmetic on a pointer to an incomplete type 'typeof(struct cpu)' (aka 'struct cpu')
The of_platform.h header is not necessary either, so it can be dropped.
---
Please ack and I will take the series via the DT tree.
--- arch/riscv/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/setup.c +1 -1
@@ -8,6 +8,7 @@* Nick Kossifidis <[email protected]> */ +#include <linux/cpu.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/memblock.h>
@@ -15,7 +16,6 @@#include <linux/console.h> #include <linux/screen_info.h> #include <linux/of_fdt.h> -#include <linux/of_platform.h> #include <linux/sched/task.h> #include <linux/smp.h> #include <linux/efi.h>
Signature · 1 line
2.39.2
Re: [PATCH 08/19] riscv: Add explicit include for cpu.h
Quoted 27 lines · On Wed, 29 Mar 2023 08:52:05 PDT (-0700), [email protected] wrote:
Removing the include of
cpu.hfromof_device.h(included byof_platform.h) causes an error insetup.c:
arch/riscv/kernel/setup.c:313:22: error: arithmetic on a pointer to an incomplete type 'typeof(struct cpu)' (aka 'struct cpu')The
of_platform.hheader is not necessary either, so it can be dropped.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.--- arch/riscv/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/kernel/setup.c +1
-0@@ -8,6 +8,7 @@* Nick Kossifidis <[email protected]> */ +#include <linux/cpu.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/memblock.h>
arch/riscv/kernel/setup.c line 21
Quoted 7 lines
arch/riscv/kernel/setup.c +0
-1@@ -15,7 +16,6 @@#include <linux/console.h> #include <linux/screen_info.h> #include <linux/of_fdt.h> -#include <linux/of_platform.h> #include <linux/sched/task.h> #include <linux/smp.h> #include <linux/efi.h>
Rob Herring
maintainerPATCH 9/19 riscv: cacheinfo: Adjust includes to remove of_device.h
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included by of_device.h (cpu.h and of.h) and drop including of_device.h.
---
Please ack and I will take the series via the DT tree.
--- arch/riscv/kernel/cacheinfo.c | 1 - 1 file changed, 1 deletion(-)
arch/riscv/kernel/cacheinfo.c +0 -1
@@ -5,7 +5,6 @@#include <linux/cpu.h> #include <linux/of.h> -#include <linux/of_device.h> #include <asm/cacheinfo.h> static struct riscv_cacheinfo_ops *rv_cache_ops;
Signature · 1 line
2.39.2
Re: [PATCH 09/19] riscv: cacheinfo: Adjust includes to remove of_device.h
Quoted 17 lines · On Wed, 29 Mar 2023 08:52:06 PDT (-0700), [email protected] wrote:
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.handof.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.--- arch/riscv/kernel/cacheinfo.c | 1 - 1 file changed, 1 deletion(-)arch/riscv/kernel/cacheinfo.c +0
-0
arch/riscv/kernel/cacheinfo.c line 10
Quoted 7 lines
arch/riscv/kernel/cacheinfo.c +0
-1@@ -5,7 +5,6 @@#include <linux/cpu.h> #include <linux/of.h> -#include <linux/of_device.h> #include <asm/cacheinfo.h> static struct riscv_cacheinfo_ops *rv_cache_ops;
Rob Herring
maintainerPATCH 10/19 cacheinfo: Adjust includes to remove of_device.h
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Update the includes to use of.h instead of of_device.h.
---
Please ack and I will take the series via the DT tree.
--- drivers/base/cacheinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/cacheinfo.c +1 -1
@@ -14,7 +14,7 @@#include <linux/cpu.h> #include <linux/device.h> #include <linux/init.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/sched.h> #include <linux/slab.h> #include <linux/smp.h>
Signature · 1 line
2.39.2
Re: [PATCH 10/19] cacheinfo: Adjust includes to remove of_device.h
Quoted 8 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Update the includes to useof.hinstead ofof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
---
Re: [PATCH 10/19] cacheinfo: Adjust includes to remove of_device.h
In reply to Rob HerringQuoted 4 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Update the includes to useof.hinstead ofof_device.h.
Signature · 2 lines
Regards, Sudeep
Rob Herring
maintainerPATCH 11/19 clocksource: ingenic: Add explicit include for cpuhotplug.h
In reply to Rob HerringRemoving include of cpu.h from of_device.h (included by of_platform.h) causes an error in ingenic-timer:
drivers/clocksource/ingenic-timer.c: In function ‘ingenic_tcu_init’:drivers/clocksource/ingenic-timer.c:338:15: error: implicit declaration of function ‘cpuhp_setup_state’
The of_platform.h header is not necessary either, so it and of_address.h can be dropped.
---
Please ack and I will take the series via the DT tree.
--- drivers/clocksource/ingenic-timer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clocksource/ingenic-timer.c +1 -2
@@ -9,13 +9,12 @@#include <linux/clk.h> #include <linux/clockchips.h> #include <linux/clocksource.h> +#include <linux/cpuhotplug.h> #include <linux/interrupt.h> #include <linux/mfd/ingenic-tcu.h> #include <linux/mfd/syscon.h> #include <linux/of.h> -#include <linux/of_address.h> #include <linux/of_irq.h> -#include <linux/of_platform.h> #include <linux/overflow.h> #include <linux/platform_device.h> #include <linux/regmap.h>
Signature · 1 line
2.39.2
Re: [PATCH 11/19] clocksource: ingenic: Add explicit include for cpuhotplug.h
Quoted 6 lines · Rob Herring
Removing include of
cpu.hfromof_device.h(included byof_platform.h) causes an error in ingenic-timer:
drivers/clocksource/ingenic-timer.c: In function ‘ingenic_tcu_init’:drivers/clocksource/ingenic-timer.c:338:15: error: implicit declaration of function ‘cpuhp_setup_state’
Quoted 7 lines
The
of_platform.hheader is not necessary either, so it andof_address.hcan be dropped.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
---
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rob Herring
maintainerPATCH 12/19 thermal: cpuidle_cooling: Adjust includes to remove of_device.h
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included by of_device.h (cpu.h and of.h) and drop including of_device.h.
---
Please ack and I will take the series via the DT tree.
--- drivers/thermal/cpuidle_cooling.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/cpuidle_cooling.c +2 -1
@@ -7,12 +7,13 @@*/ #define pr_fmt (fmt) "cpuidle cooling: " fmt +#include <linux/cpu.h> #include <linux/cpu_cooling.h> #include <linux/cpuidle.h> #include <linux/device.h> #include <linux/err.h> #include <linux/idle_inject.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/slab.h> #include <linux/thermal.h>
Signature · 1 line
2.39.2
Re: [PATCH 12/19] thermal: cpuidle_cooling: Adjust includes to remove of_device.h
Quoted 9 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.handof.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
Quoted 27 lines
--- drivers/thermal/cpuidle_cooling.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/thermal/cpuidle_cooling.c +2
-2@@ -7,12 +7,13 @@*/ #define pr_fmt (fmt) "cpuidle cooling: " fmt +#include <linux/cpu.h> #include <linux/cpu_cooling.h> #include <linux/cpuidle.h> #include <linux/device.h> #include <linux/err.h> #include <linux/idle_inject.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/slab.h> #include <linux/thermal.h> --2.39.2
Re: [PATCH 12/19] thermal: cpuidle_cooling: Adjust includes to remove of_device.h
In reply to Rob HerringQuoted 8 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.handof.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rob Herring
maintainerPATCH 13/19 soc: mediatek: mtk-svs: Add explicit include for cpu.h
In reply to Rob HerringRemoving the include of cpu.h from of_device.h (included by of_platform.h) causes an error:
drivers/soc/mediatek/mtk-svs.c:2134:41: error: implicit declaration of function 'get_cpu_device'; did you mean 'get_swap_device'? [-Werror=implicit-function-declaration]
of_platform.h is still needed for of_find_device_by_node().
---
Please ack and I will take the series via the DT tree.
--- drivers/soc/mediatek/mtk-svs.c | 1 + 1 file changed, 1 insertion(+)
drivers/soc/mediatek/mtk-svs.c +1 -0
@@ -7,6 +7,7 @@#include <linux/bits.h> #include <linux/clk.h> #include <linux/completion.h> +#include <linux/cpu.h> #include <linux/cpuidle.h> #include <linux/debugfs.h> #include <linux/device.h>
Signature · 1 line
2.39.2
Rob Herring
maintainerPATCH 14/19 cpufreq: Adjust includes to remove of_device.h
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included by of_device.h (cpu.h and of.h) and drop including of_device.h.
---
Please ack and I will take the series via the DT tree.
--- drivers/cpufreq/cpufreq-dt-platdev.c | 1 - drivers/cpufreq/kirkwood-cpufreq.c | 2 +- drivers/cpufreq/maple-cpufreq.c | 2 +- drivers/cpufreq/pmac32-cpufreq.c | 2 +- drivers/cpufreq/pmac64-cpufreq.c | 2 +- drivers/cpufreq/qcom-cpufreq-hw.c | 4 ++-- drivers/cpufreq/spear-cpufreq.c | 2 +- drivers/cpufreq/tegra124-cpufreq.c | 1 - drivers/cpufreq/tegra20-cpufreq.c | 2 +- include/linux/cpufreq.h | 1 - 10 files changed, 8 insertions(+), 11 deletions(-)
drivers/cpufreq/cpufreq-dt-platdev.c +0 -1
@@ -6,7 +6,6 @@#include <linux/err.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include "cpufreq-dt.h"
drivers/cpufreq/kirkwood-cpufreq.c +1 -1
@@ -9,7 +9,7 @@#include <linux/module.h> #include <linux/clk.h> #include <linux/cpufreq.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/io.h> #include <asm/proc-fns.h>
drivers/cpufreq/maple-cpufreq.c +1 -1
@@ -23,7 +23,7 @@#include <linux/completion.h> #include <linux/mutex.h> #include <linux/time.h> -#include <linux/of_device.h> +#include <linux/of.h> #define DBG(fmt...) pr_debug(fmt)
drivers/cpufreq/pmac32-cpufreq.c +1 -1
@@ -23,7 +23,7 @@#include <linux/init.h> #include <linux/device.h> #include <linux/hardirq.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <asm/machdep.h> #include <asm/irq.h>
drivers/cpufreq/pmac64-cpufreq.c +1 -1
@@ -21,7 +21,7 @@#include <linux/init.h> #include <linux/completion.h> #include <linux/mutex.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <asm/machdep.h> #include <asm/irq.h>
drivers/cpufreq/qcom-cpufreq-hw.c +2 -2
@@ -11,8 +11,8 @@#include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> +#include <linux/of.h> +#include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/pm_qos.h> #include <linux/slab.h>
drivers/cpufreq/spear-cpufreq.c +1 -1
@@ -18,7 +18,7 @@#include <linux/err.h> #include <linux/init.h> #include <linux/module.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/types.h>
drivers/cpufreq/tegra124-cpufreq.c +0 -1
@@ -11,7 +11,6 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/of_device.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_opp.h>
drivers/cpufreq/tegra20-cpufreq.c +1 -1
@@ -12,7 +12,7 @@#include <linux/err.h> #include <linux/init.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/types.h>
include/linux/cpufreq.h +0 -1
@@ -15,7 +15,6 @@#include <linux/kobject.h> #include <linux/notifier.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/pm_opp.h> #include <linux/pm_qos.h> #include <linux/spinlock.h>
Signature · 1 line
2.39.2
Re: [PATCH 14/19] cpufreq: Adjust includes to remove of_device.h
Quoted 9 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.handof.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
Quoted 146 lines
--- drivers/cpufreq/cpufreq-dt-platdev.c | 1 - drivers/cpufreq/kirkwood-cpufreq.c | 2 +- drivers/cpufreq/maple-cpufreq.c | 2 +- drivers/cpufreq/pmac32-cpufreq.c | 2 +- drivers/cpufreq/pmac64-cpufreq.c | 2 +- drivers/cpufreq/qcom-cpufreq-hw.c | 4 ++-- drivers/cpufreq/spear-cpufreq.c | 2 +- drivers/cpufreq/tegra124-cpufreq.c | 1 - drivers/cpufreq/tegra20-cpufreq.c | 2 +- include/linux/cpufreq.h | 1 - 10 files changed, 8 insertions(+), 11 deletions(-)drivers/cpufreq/cpufreq-dt-platdev.c +0
-1@@ -6,7 +6,6 @@#include <linux/err.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include "cpufreq-dt.h" drivers/cpufreq/kirkwood-cpufreq.c +1
-1@@ -9,7 +9,7 @@#include <linux/module.h> #include <linux/clk.h> #include <linux/cpufreq.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/io.h> #include <asm/proc-fns.h> drivers/cpufreq/maple-cpufreq.c +1
-1@@ -23,7 +23,7 @@#include <linux/completion.h> #include <linux/mutex.h> #include <linux/time.h> -#include <linux/of_device.h> +#include <linux/of.h> #define DBG(fmt...) pr_debug(fmt)drivers/cpufreq/pmac32-cpufreq.c +1
-1@@ -23,7 +23,7 @@#include <linux/init.h> #include <linux/device.h> #include <linux/hardirq.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <asm/machdep.h> #include <asm/irq.h> drivers/cpufreq/pmac64-cpufreq.c +1
-1@@ -21,7 +21,7 @@#include <linux/init.h> #include <linux/completion.h> #include <linux/mutex.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <asm/machdep.h> #include <asm/irq.h> drivers/cpufreq/qcom-cpufreq-hw.c +2
-2@@ -11,8 +11,8 @@#include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> +#include <linux/of.h> +#include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/pm_qos.h> #include <linux/slab.h> drivers/cpufreq/spear-cpufreq.c +1
-1@@ -18,7 +18,7 @@#include <linux/err.h> #include <linux/init.h> #include <linux/module.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/types.h> drivers/cpufreq/tegra124-cpufreq.c +0
-1@@ -11,7 +11,6 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/of_device.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_opp.h> drivers/cpufreq/tegra20-cpufreq.c +1
-1@@ -12,7 +12,7 @@#include <linux/err.h> #include <linux/init.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/types.h> include/linux/cpufreq.h +0
-2@@ -15,7 +15,6 @@#include <linux/kobject.h> #include <linux/notifier.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/pm_opp.h> #include <linux/pm_qos.h> #include <linux/spinlock.h> --2.39.2
kernel test robot
build botRe: [PATCH 14/19] cpufreq: Adjust includes to remove of_device.h
In reply to Rob HerringI love your patch! Yet something to improve:
Hi Rob,
I love your patch! Yet something to improve:
[auto build test ERROR on fe15c26ee26efa11741a7b632e9f23b01aca4cc6]
url: https://github.com/intel-lab-lkp/linux/commits/Rob-Herring/of-Make-devtree_lock-declaration-private/20230329-235635 base: fe15c26ee26efa11741a7b632e9f23b01aca4cc6 patch link: https://lore.kernel.org/r/20230329-dt-cpu-header-cleanups-v1-14-581e2605fe47%40kernel.org patch subject: [PATCH 14/19] cpufreq: Adjust includes to remove of_device.h config: xtensa-randconfig-r033-20230329 (https://download.01.org/0day-ci/archive/20230330/[email protected]/config) compiler: xtensa-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/2d8d18f806b57611002876b9921aae0d041bbe63
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Rob-Herring/of-Make-devtree_lock-declaration-private/20230329-235635
git checkout 2d8d18f806b57611002876b9921aae0d041bbe63
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=xtensa olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=xtensa SHELL=/bin/bash drivers/tty/serial/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/tty/serial/samsung_tty.c: In function 's3c24xx_get_driver_data':
>> drivers/tty/serial/samsung_tty.c:2034:24: error: implicit declaration of function 'of_device_get_match_data'; did you mean 'device_get_match_data'? [-Werror=implicit-function-declaration]
2034 | return of_device_get_match_data(&pdev->dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| device_get_match_data
drivers/tty/serial/samsung_tty.c:2034:24: warning: returning 'int' from a function with return type 'const struct s3c24xx_serial_drv_data *' makes pointer from integer without a cast [-Wint-conversion]
2034 | return of_device_get_match_data(&pdev->dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: some warnings being treated as errors
vim +2034 drivers/tty/serial/samsung_tty.c
b497549a035c2a drivers/serial/samsung.c Ben Dooks 2008-07-03 2029
97a6cfe8115b04 drivers/tty/serial/samsung_tty.c Krzysztof Kozlowski 2022-03-08 2030 static inline const struct s3c24xx_serial_drv_data *
695b847b247cff drivers/tty/serial/samsung_tty.c Krzysztof Kozlowski 2020-06-17 2031 s3c24xx_get_driver_data(struct platform_device *pdev)
26c919e1d3f4df drivers/tty/serial/samsung.c Thomas Abraham 2011-11-06 2032 {
f25fbd5b1ef377 drivers/tty/serial/samsung_tty.c Krzysztof Kozlowski 2022-03-08 2033 if (dev_of_node(&pdev->dev))
f25fbd5b1ef377 drivers/tty/serial/samsung_tty.c Krzysztof Kozlowski 2022-03-08 @2034 return of_device_get_match_data(&pdev->dev);
9fe0d41ffd39cb drivers/tty/serial/samsung_tty.c Greg Kroah-Hartman 2019-12-10 2035
26c919e1d3f4df drivers/tty/serial/samsung.c Thomas Abraham 2011-11-06 2036 return (struct s3c24xx_serial_drv_data *)
26c919e1d3f4df drivers/tty/serial/samsung.c Thomas Abraham 2011-11-06 2037 platform_get_device_id(pdev)->driver_data;
26c919e1d3f4df drivers/tty/serial/samsung.c Thomas Abraham 2011-11-06 2038 }
26c919e1d3f4df drivers/tty/serial/samsung.c Thomas Abraham 2011-11-06 2039 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests
Re: [PATCH 14/19] cpufreq: Adjust includes to remove of_device.h
In reply to Rob HerringQuoted 8 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.handof.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
Quoted 12 lines
--- drivers/cpufreq/cpufreq-dt-platdev.c | 1 - drivers/cpufreq/kirkwood-cpufreq.c | 2 +- drivers/cpufreq/maple-cpufreq.c | 2 +- drivers/cpufreq/pmac32-cpufreq.c | 2 +- drivers/cpufreq/pmac64-cpufreq.c | 2 +- drivers/cpufreq/qcom-cpufreq-hw.c | 4 ++-- drivers/cpufreq/spear-cpufreq.c | 2 +- drivers/cpufreq/tegra124-cpufreq.c | 1 - drivers/cpufreq/tegra20-cpufreq.c | 2 +- include/linux/cpufreq.h | 1 - 10 files changed, 8 insertions(+), 11 deletions(-)
Signature · 1 line
viresh
Rob Herring
maintainerPATCH 15/19 cpufreq: sun50i: Add explicit include for cpu.h
In reply to Rob HerringRemoving the include of cpu.h from of_device.h causes an error:
drivers/cpufreq/sun50i-cpufreq-nvmem.c:42:19: error: implicit declaration of function ‘get_cpu_device’; did you mean ‘get_device’? [-Werror=implicit-function-declaration]
As of_device.h is not otherwise needed, it can be replaced with of.h (also implicitly included).
---
Please ack and I will take the series via the DT tree.
--- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/cpufreq/sun50i-cpufreq-nvmem.c +2 -1
@@ -10,9 +10,10 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/cpu.h> #include <linux/module.h> #include <linux/nvmem-consumer.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/slab.h>
Signature · 1 line
2.39.2
Re: [PATCH 15/19] cpufreq: sun50i: Add explicit include for cpu.h
Dne sreda, 29. marec 2023 ob 17:52:12 CEST je Rob Herring napisal(a):
Quoted 11 lines
Removing the include of
cpu.hfromof_device.hcauses an error:
drivers/cpufreq/sun50i-cpufreq-nvmem.c:42:19: error: implicit declaration of function ‘get_cpu_device’; did you mean ‘get_device’? [-Werror=implicit-function-declaration]As
of_device.his not otherwise needed, it can be replaced withof.h(also implicitly included).Signed-off-by Rob Herring <[email protected]>---
Best regards,
Jernej
Re: [PATCH 15/19] cpufreq: sun50i: Add explicit include for cpu.h
In reply to Rob HerringQuoted 20 lines · Rob Herring
Removing the include of
cpu.hfromof_device.hcauses an error:
drivers/cpufreq/sun50i-cpufreq-nvmem.c:42:19: error: implicit declaration of function ‘get_cpu_device’; did you mean ‘get_device’? [-Werror=implicit-function-declaration]As
of_device.his not otherwise needed, it can be replaced withof.h(also implicitly included).Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.--- drivers/cpufreq/sun50i-cpufreq-nvmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/cpufreq/sun50i-cpufreq-nvmem.c +0
-0@@ -10,9 +10,10 @@
drivers/cpufreq/sun50i-cpufreq-nvmem.c line 19
Quoted 10 lines
drivers/cpufreq/sun50i-cpufreq-nvmem.c +2
-1#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <linux/cpu.h> #include <linux/module.h> #include <linux/nvmem-consumer.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/slab.h>
Signature · 1 line
viresh
Rob Herring
maintainerPATCH 16/19 cpuidle: Adjust includes to remove of_device.h
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included by of_device.h (cpu.h, cpuhotplug.h, of.h, and of_platform.h) and drop including of_device.h.
---
Please ack and I will take the series via the DT tree.
--- drivers/cpuidle/cpuidle-psci.c | 1 - drivers/cpuidle/cpuidle-qcom-spm.c | 3 +-- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/cpuidle/dt_idle_states.c | 1 - 4 files changed, 2 insertions(+), 5 deletions(-)
drivers/cpuidle/cpuidle-psci.c +0 -1
@@ -16,7 +16,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/psci.h> #include <linux/pm_domain.h>
drivers/cpuidle/cpuidle-qcom-spm.c +1 -2
@@ -11,8 +11,7 @@#include <linux/io.h> #include <linux/slab.h> #include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_device.h> +#include <linux/of_platform.h> #include <linux/err.h> #include <linux/platform_device.h> #include <linux/cpuidle.h>
drivers/cpuidle/cpuidle-riscv-sbi.c +1 -1
@@ -8,6 +8,7 @@#define pr_fmt (fmt) "cpuidle-riscv-sbi: " fmt +#include <linux/cpuhotplug.h> #include <linux/cpuidle.h> #include <linux/cpumask.h> #include <linux/cpu_pm.h>
@@ -15,7 +16,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/slab.h> #include <linux/platform_device.h> #include <linux/pm_domain.h>
drivers/cpuidle/dt_idle_states.c +0 -1
@@ -14,7 +14,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include "dt_idle_states.h"
Signature · 1 line
2.39.2
Re: [PATCH 16/19] cpuidle: Adjust includes to remove of_device.h
Quoted 9 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.h,cpuhotplug.h,of.h, andof_platform.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.
Quoted 69 lines
--- drivers/cpuidle/cpuidle-psci.c | 1 - drivers/cpuidle/cpuidle-qcom-spm.c | 3 +-- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/cpuidle/dt_idle_states.c | 1 - 4 files changed, 2 insertions(+), 5 deletions(-)drivers/cpuidle/cpuidle-psci.c +0
-1@@ -16,7 +16,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/psci.h> #include <linux/pm_domain.h> drivers/cpuidle/cpuidle-qcom-spm.c +1
-2@@ -11,8 +11,7 @@#include <linux/io.h> #include <linux/slab.h> #include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_device.h> +#include <linux/of_platform.h> #include <linux/err.h> #include <linux/platform_device.h> #include <linux/cpuidle.h> drivers/cpuidle/cpuidle-riscv-sbi.c +1
-1@@ -8,6 +8,7 @@#define pr_fmt (fmt) "cpuidle-riscv-sbi: " fmt +#include <linux/cpuhotplug.h> #include <linux/cpuidle.h> #include <linux/cpumask.h> #include <linux/cpu_pm.h> @@ -15,7 +16,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/slab.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> drivers/cpuidle/dt_idle_states.c +0
-2@@ -14,7 +14,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include "dt_idle_states.h" --2.39.2
Re: [PATCH 16/19] cpuidle: Adjust includes to remove of_device.h
In reply to Rob HerringQuoted 20 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.h,cpuhotplug.h,of.h, andof_platform.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.--- drivers/cpuidle/cpuidle-psci.c | 1 - drivers/cpuidle/cpuidle-qcom-spm.c | 3 +-- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/cpuidle/dt_idle_states.c | 1 - 4 files changed, 2 insertions(+), 5 deletions(-)drivers/cpuidle/cpuidle-psci.c +0
-0
drivers/cpuidle/cpuidle-psci.c line 21
Quoted 7 lines
drivers/cpuidle/cpuidle-psci.c +0
-1@@ -16,7 +16,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/psci.h> #include <linux/pm_domain.h>
Signature · 2 lines
Regards, Sudeep
Re: [PATCH 16/19] cpuidle: Adjust includes to remove of_device.h
In reply to Rob HerringQuoted 7 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.h,cpuhotplug.h,of.h, andof_platform.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>
For cpuidle-riscv-sbi.c
Regards,
Anup
Quoted 71 lines
---
Please ack and I will take the series via the DT tree.--- drivers/cpuidle/cpuidle-psci.c | 1 - drivers/cpuidle/cpuidle-qcom-spm.c | 3 +-- drivers/cpuidle/cpuidle-riscv-sbi.c | 2 +- drivers/cpuidle/dt_idle_states.c | 1 - 4 files changed, 2 insertions(+), 5 deletions(-)drivers/cpuidle/cpuidle-psci.c +0
-1@@ -16,7 +16,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/psci.h> #include <linux/pm_domain.h> drivers/cpuidle/cpuidle-qcom-spm.c +1
-2@@ -11,8 +11,7 @@#include <linux/io.h> #include <linux/slab.h> #include <linux/of.h> -#include <linux/of_address.h> -#include <linux/of_device.h> +#include <linux/of_platform.h> #include <linux/err.h> #include <linux/platform_device.h> #include <linux/cpuidle.h> drivers/cpuidle/cpuidle-riscv-sbi.c +1
-1@@ -8,6 +8,7 @@#define pr_fmt (fmt) "cpuidle-riscv-sbi: " fmt +#include <linux/cpuhotplug.h> #include <linux/cpuidle.h> #include <linux/cpumask.h> #include <linux/cpu_pm.h> @@ -15,7 +16,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/slab.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> drivers/cpuidle/dt_idle_states.c +0
-2@@ -14,7 +14,6 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include "dt_idle_states.h" --2.39.2
Rob Herring
maintainerPATCH 17/19 irqchip: loongson-eiointc: Add explicit include for cpuhotplug.h
In reply to Rob HerringRemoving the include of cpu.h from of_device.h causes an error:
drivers/irqchip/irq-loongson-eiointc.c:420:9: error: implicit declaration of function 'cpuhp_setup_state_nocalls' [-Werror=implicit-function-declaration]
This driver doesn't even use DT, so all the DT includes can be dropped.
---
Please ack and I will take the series via the DT tree.
--- drivers/irqchip/irq-loongson-eiointc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/irqchip/irq-loongson-eiointc.c +1 -4
@@ -7,16 +7,13 @@#define pr_fmt (fmt) "eiointc: " fmt +#include <linux/cpuhotplug.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/irqchip.h> #include <linux/irqdomain.h> #include <linux/irqchip/chained_irq.h> #include <linux/kernel.h> -#include <linux/platform_device.h> -#include <linux/of_address.h> -#include <linux/of_irq.h> -#include <linux/of_platform.h> #include <linux/syscore_ops.h> #define EIOINTC_REG_NODEMAP 0x14a0
Signature · 1 line
2.39.2
Rob Herring
maintainerPATCH 18/19 OPP: Adjust includes to remove of_device.h
In reply to Rob HerringNow that of_cpu_device_node_get() is defined in of.h, of_device.h is just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included by of_device.h (cpu.h and of.h) and drop including of_device.h.
---
Please ack and I will take the series via the DT tree.
--- drivers/opp/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/opp/of.c +1 -1
@@ -13,7 +13,7 @@#include <linux/cpu.h> #include <linux/errno.h> #include <linux/device.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/pm_domain.h> #include <linux/slab.h> #include <linux/export.h>
Signature · 1 line
2.39.2
Re: [PATCH 18/19] OPP: Adjust includes to remove of_device.h
Quoted 17 lines · Rob Herring
Now that
of_cpu_device_node_get()is defined inof.h,of_device.his just implicitly including other includes, and is no longer needed. Adjust the include files with what was implicitly included byof_device.h(cpu.handof.h) and drop includingof_device.h.Signed-off-by Rob Herring <[email protected]>---
Please ack and I will take the series via the DT tree.--- drivers/opp/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/opp/of.c +0
-0
drivers/opp/of.c line 19
Quoted 8 lines
drivers/opp/of.c +1
-1@@ -13,7 +13,7 @@#include <linux/cpu.h> #include <linux/errno.h> #include <linux/device.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/pm_domain.h> #include <linux/slab.h> #include <linux/export.h>
Signature · 1 line
viresh
Rob Herring
maintainerPATCH 19/19 of: Drop cpu.h include from of_device.h
In reply to Rob HerringNow that all users which had an implicit dependency on cpu.h have been fixed. the cpu.h include can be dropped from of_device.h
--- include/linux/of_device.h | 1 - 1 file changed, 1 deletion(-)
include/linux/of_device.h +0 -1
@@ -2,7 +2,6 @@#ifndef _LINUX_OF_DEVICE_H#define _LINUX_OF_DEVICE_H -#include <linux/cpu.h> #include <linux/platform_device.h> #include <linux/of_platform.h> /* temporary until merge */
Signature · 1 line
2.39.2