1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Profpatsch <mail@profpatsch.de>
Subject: [PATCH 15/28] disp: class_create() without THIS_MODULE from 6.4 on

Linux 6.4 dropped class_create()'s owner argument; pick the call by
kernel version. Unchanged on 4.9.
---
 drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c b/drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c
index e78d57ab..8819dd27 100755
--- a/drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c
+++ b/drivers/video/fbdev/sunxi/disp2/disp/dev_disp.c
@@ -9,6 +9,7 @@
  */
 
 #include "dev_disp.h"
+#include <linux/version.h>
 #include <linux/pm_runtime.h>
 #if defined(CONFIG_DEVFREQ_DRAM_FREQ_WITH_SOFT_NOTIFY)
 #include <linux/sunxi_dramfreq.h>
@@ -4184,7 +4185,12 @@ static int __init disp_module_init(void)
 		return -1;
 	}
 
+	/* class_create() lost its owner argument in Linux 6.4. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
 	disp_class = class_create(THIS_MODULE, "disp");
+#else
+	disp_class = class_create("disp");
+#endif
 	if (IS_ERR(disp_class)) {
 		__wrn("class_create fail\n");
 		return -1;