forked from BeardOverflow/msi-ec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
older-kernel.patch
35 lines (31 loc) · 1.01 KB
/
older-kernel.patch
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
diff --git a/msi-ec.c b/msi-ec.c
index 406f493..98b14a9 100644
--- a/msi-ec.c
+++ b/msi-ec.c
@@ -45,6 +45,7 @@
#include <linux/seq_file.h>
#include <linux/string.h>
#include <linux/slab.h>
+#include <linux/version.h>
static const char *const SM_ECO_NAME = "eco";
static const char *const SM_COMFORT_NAME = "comfort";
@@ -923,14 +924,22 @@ static struct attribute *msi_battery_attrs[] = {
ATTRIBUTE_GROUPS(msi_battery);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0)
static int msi_battery_add(struct power_supply *battery,
struct acpi_battery_hook *hook)
+#else
+static int msi_battery_add(struct power_supply *battery)
+#endif
{
return device_add_groups(&battery->dev, msi_battery_groups);
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0)
static int msi_battery_remove(struct power_supply *battery,
struct acpi_battery_hook *hook)
+#else
+static int msi_battery_remove(struct power_supply *battery)
+#endif
{
device_remove_groups(&battery->dev, msi_battery_groups);
return 0;