BeardOverflow / msi-ec

GNU General Public License v2.0
134 stars 42 forks source link

Port to Linux 6.2 #29

Closed teackot closed 1 year ago

teackot commented 1 year ago

27

Patch for Linux < 6.2 is provided

BeardOverflow commented 1 year ago

Hello @teackot In order to support older and newer kernels, your patch would be more generic, using the KERNEL_VERSION macro. For example:

#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

However, remember that in the official Linux' staging tree should not be typed any LINUX_VERSION_CODE. So, my proposal is: just keep the patch, but using KERNEL_VERSION macro and renaming it to a generic name like older-kernel.patch.

teackot commented 1 year ago

Hi! I updated and renamed the patch considering your remarks

BeardOverflow commented 1 year ago

Great, now your PR is totally ready. Thanks a lot for providing this patch, it will be useful for older linux distros.