Skip to content

Commit

Permalink
fix: Make legion_remove return void and set remove_new
Browse files Browse the repository at this point in the history
The type of .remove in platform_driver changed from

int (*)(struct platform_drive*)

to

void (*)(struct platform_drive*)

in kernel 6.11 to force migration. In version before

.remove_new has type

void (*)(struct platform_drive*)

to allows a migration. We use remove_new to make it
commpatible with different kernels.
  • Loading branch information
johnfan committed Sep 7, 2024
1 parent 680ed61 commit 61f05e0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel_module/legion-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -6084,7 +6084,7 @@ static int legion_add(struct platform_device *pdev)
return err;
}

static int legion_remove(struct platform_device *pdev)
static void legion_remove(struct platform_device *pdev)
{
struct legion_private *priv = dev_get_drvdata(&pdev->dev);

Expand Down Expand Up @@ -6112,7 +6112,6 @@ static int legion_remove(struct platform_device *pdev)
legion_shared_exit(priv);

pr_info("Legion platform unloaded\n");
return 0;
}

static int legion_resume(struct platform_device *pdev)
Expand Down Expand Up @@ -6144,7 +6143,7 @@ MODULE_DEVICE_TABLE(acpi, legion_device_ids);

static struct platform_driver legion_driver = {
.probe = legion_add,
.remove = legion_remove,
.remove_new = legion_remove,
.resume = legion_resume,
.driver = {
.name = "legion",
Expand Down

0 comments on commit 61f05e0

Please sign in to comment.