Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

Build failure on kernel 6.1.x: incompatible platform_driver->remove signature #87

@darioackermann

Description

@darioackermann

Description

The DKMS module fails to build on recent kernels (tested on 6.1.165-1-MANJARO) due to an incompatible function pointer type for the platform_driver->remove callback.


Error output

error: assignment to 'int (*)(struct platform_device *)'
from incompatible pointer type 'void (*)(struct platform_device *)'

platform_driver->remove = asus_fan_remove;

note: 'asus_fan_remove' declared here
static void asus_fan_remove(struct platform_device *device)

Cause

The kernel expects the remove callback to have the signature:

int (*remove)(struct platform_device *)

However, the module defines:

static void asus_fan_remove(struct platform_device *device)

This results in a build failure due to the mismatched return type.


Proposed fix

Change the function signature to return int and add a return value:

static int asus_fan_remove(struct platform_device *device) {
    ...
    return 0;
}

Environment

  • Kernel: 6.1.165-1-MANJARO (x86_64)
  • DKMS: 3.3.0
  • Distribution: Manjaro Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions