Skip to content

Commit

Permalink
fixed faulty kernel version check
Browse files Browse the repository at this point in the history
  • Loading branch information
lg28literconvectionmicrowaveoven authored and MrDuartePT committed Feb 4, 2025
1 parent 52bf5d7 commit ae96a82
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions kernel_module/legion-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,8 @@ static bool fancurve_get_speed_pwm(const struct fancurve *fancurve,
int speed;

pr_info("%s 1 point id=%d, fancurve=%p, fancurve.fan_speed_unit=%d, fancurve.size=%ld",
__func__, point_id, (void *) fancurve, fancurve->fan_speed_unit, fancurve->size);
__func__, point_id, (void *)fancurve, fancurve->fan_speed_unit,
fancurve->size);

if (!(point_id < fancurve->size && fan_id >= 0 && fan_id < 2)) {
pr_err("Reading point id %d, fan id %d not valid for fancurve with size %ld",
Expand Down Expand Up @@ -5120,8 +5121,8 @@ static ssize_t autopoint_show(struct device *dev,
bool ok = true;

pr_info("%s 1 point id=%d, fancurve_attr_id id=%d, fancurve.fan_speed_unit=%d, fancurve.size=%ld",
__func__, point_id, fancurve_attr_id,
fancurve.fan_speed_unit, fancurve.size);
__func__, point_id, fancurve_attr_id, fancurve.fan_speed_unit,
fancurve.size);

mutex_lock(&priv->fancurve_mutex);
err = read_fancurve(priv, &fancurve);
Expand Down Expand Up @@ -6267,10 +6268,10 @@ MODULE_DEVICE_TABLE(acpi, legion_device_ids);

static struct platform_driver legion_driver = {
.probe = legion_add,
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0)
.remove_new = legion_remove,
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
.remove = legion_remove,
#else
.remove_new = legion_remove,
#endif
.resume = legion_resume,
.driver = {
Expand Down

0 comments on commit ae96a82

Please sign in to comment.