Skip to content

Commit e68455e

Browse files
committed
[Kernel][ppc64][aarch64][riscv64] Fix missing OF function prototypes
Include <linux/of_device.h> when CONFIG_OF is enabled on kernels prior to v6.4 to restore missing device-tree related function prototypes.
1 parent 84b0e22 commit e68455e

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

aarch64/corefreqk.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,20 @@
4040
#endif
4141
#ifdef CONFIG_OF
4242
#include <linux/of.h>
43+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
44+
#include <linux/of_device.h>
4345
#endif
46+
#endif /* CONFIG_OF */
4447
#ifdef CONFIG_ACPI
4548
#include <linux/acpi.h>
4649
#include <acpi/processor.h>
47-
#endif
50+
#endif /* CONFIG_ACPI */
4851
#ifdef CONFIG_ACPI_CPPC_LIB
4952
#include <acpi/cppc_acpi.h>
50-
#endif
53+
#endif /* CONFIG_ACPI_CPPC_LIB */
5154
#ifdef CONFIG_THERMAL
5255
#include <linux/thermal.h>
53-
#endif
56+
#endif /* CONFIG_THERMAL */
5457

5558
#ifdef CONFIG_HAVE_NMI
5659
enum {

ppc64le/corefreqk.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,17 @@
3838
#ifdef CONFIG_ACPI
3939
#include <linux/acpi.h>
4040
#include <acpi/processor.h>
41-
#endif
41+
#endif /* CONFIG_ACPI */
4242
#ifdef CONFIG_ACPI_CPPC_LIB
4343
#include <acpi/cppc_acpi.h>
44-
#endif
44+
#endif /* CONFIG_ACPI_CPPC_LIB */
4545
#include <asm/cputhreads.h>
46+
#ifdef CONFIG_OF
47+
#include <linux/of.h>
48+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
49+
#include <linux/of_device.h>
50+
#endif
51+
#endif /* CONFIG_OF */
4652

4753
#ifdef CONFIG_HAVE_NMI
4854
enum {

riscv64/corefreqk.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,22 @@
3636
#ifdef CONFIG_XEN
3737
#include <xen/xen.h>
3838
#endif /* CONFIG_XEN */
39+
#ifdef CONFIG_OF
40+
#include <linux/of.h>
41+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
42+
#include <linux/of_device.h>
43+
#endif
44+
#endif /* CONFIG_OF */
3945
#ifdef CONFIG_ACPI
4046
#include <linux/acpi.h>
4147
#include <acpi/processor.h>
42-
#endif
48+
#endif /* CONFIG_ACPI */
4349
#ifdef CONFIG_ACPI_CPPC_LIB
4450
#include <acpi/cppc_acpi.h>
45-
#endif
51+
#endif /* CONFIG_ACPI_CPPC_LIB */
4652
#ifdef CONFIG_THERMAL
4753
#include <linux/thermal.h>
48-
#endif
54+
#endif /* CONFIG_THERMAL */
4955

5056
#ifdef CONFIG_HAVE_NMI
5157
enum {

0 commit comments

Comments
 (0)