Skip to content

Fix driver build failures by correcting Kbuild flags and missing vmalloc header#36

Open
taraxacum45e9a wants to merge 2 commits into
Xilinx:mainfrom
taraxacum45e9a:fix35
Open

Fix driver build failures by correcting Kbuild flags and missing vmalloc header#36
taraxacum45e9a wants to merge 2 commits into
Xilinx:mainfrom
taraxacum45e9a:fix35

Conversation

@taraxacum45e9a
Copy link
Copy Markdown

@taraxacum45e9a taraxacum45e9a commented May 30, 2026

Description

This PR addresses two critical compilation issues that were preventing the AMI driver from building successfully on newer kernel versions:

  1. Inactive Compilation Flags (EXTRA_CFLAGS):
    Modern Kbuild environments deprecate or ignore local EXTRA_CFLAGS variable assignments when executing sub-makes, causing the -I include paths for local dependencies to be lost. This has been fixed by properly appending the include paths to ccflags-y.
  2. Implicit Function Declarations (vzalloc/vfree):
    The driver utilizes memory allocation functions like vzalloc() and vfree() across multiple files without explicitly importing their definitions. This caused build failures on newer, stricter kernel headers. Explicit #include <linux/vmalloc.h> directives have been added to the affected source files.

Changes

  • Makefile: Appended header include paths directly to ccflags-y instead of the defunct EXTRA_CFLAGS.
  • sw/AMI/driver/ami_amc_control.c: Added <linux/vmalloc.h> inclusion.
  • sw/AMI/driver/ami_cdev.c: Added <linux/vmalloc.h> inclusion.
  • sw/AMI/driver/ami_sensor.c: Added <linux/vmalloc.h> inclusion.
  • sw/AMI/driver/ami_sysfs.c: Added <linux/vmalloc.h> inclusion.

Fix: #35

Clean up the assignment spacing and appending operators for `ccflags-y`
to conform to standard Makefile style guidelines.

Signed-off-by: Shen Jiamin <shen_jiamin@comp.nus.edu.sg>
…n errors

The driver uses functions like vzalloc() and vfree() across multiple
files but relies on implicit header inclusion.

Fix the compilation errors by explicitly including <linux/vmalloc.h>
in ami_amc_control.c, ami_cdev.c, ami_sensor.c, and ami_sysfs.c.

Signed-off-by: Shen Jiamin <shen_jiamin@comp.nus.edu.sg>
@taraxacum45e9a taraxacum45e9a changed the title driver: Fix Kbuild compiler flags assignment in Makefile Fix driver build failures by correcting Kbuild flags and missing vmalloc header May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AMI driver compilation fails

1 participant