From 62f71e9459577d6321cbe573e9629bd84e9cfef4 Mon Sep 17 00:00:00 2001 From: Shen Jiamin Date: Wed, 25 Mar 2026 04:58:26 +0800 Subject: [PATCH 1/2] add include to multiple driver files Signed-off-by: Shen Jiamin --- sw/AMI/driver/ami_amc_control.c | 1 + sw/AMI/driver/ami_cdev.c | 1 + sw/AMI/driver/ami_sensor.c | 1 + sw/AMI/driver/ami_sysfs.c | 1 + 4 files changed, 4 insertions(+) diff --git a/sw/AMI/driver/ami_amc_control.c b/sw/AMI/driver/ami_amc_control.c index 146b3d5..583b1d6 100755 --- a/sw/AMI/driver/ami_amc_control.c +++ b/sw/AMI/driver/ami_amc_control.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "gcq.h" #include "ami_top.h" diff --git a/sw/AMI/driver/ami_cdev.c b/sw/AMI/driver/ami_cdev.c index 834e5d3..b727dc4 100755 --- a/sw/AMI/driver/ami_cdev.c +++ b/sw/AMI/driver/ami_cdev.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "ami.h" #include "ami_hwmon.h" diff --git a/sw/AMI/driver/ami_sensor.c b/sw/AMI/driver/ami_sensor.c index 9350f21..4203499 100755 --- a/sw/AMI/driver/ami_sensor.c +++ b/sw/AMI/driver/ami_sensor.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "ami_top.h" #include "ami_sensor.h" diff --git a/sw/AMI/driver/ami_sysfs.c b/sw/AMI/driver/ami_sysfs.c index f2f3122..e63e3a4 100644 --- a/sw/AMI/driver/ami_sysfs.c +++ b/sw/AMI/driver/ami_sysfs.c @@ -7,6 +7,7 @@ #include #include +#include #include "ami.h" #include "ami_top.h" From c8244e736888cadb730ab6730bd51a0167c86fce Mon Sep 17 00:00:00 2001 From: Shen Jiamin Date: Wed, 25 Mar 2026 05:09:37 +0800 Subject: [PATCH 2/2] fix Makefile for kernel module - Replace deprecated EXTRA_CFLAGS with ccflags-y. - Use $(src) for internal header include paths. - Fix KERNEL_DIR and PWD assignment. - Standardize variable referencing from ${VAR} to $(VAR). Signed-off-by: Shen Jiamin --- sw/AMI/driver/Makefile | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/sw/AMI/driver/Makefile b/sw/AMI/driver/Makefile index c429fcf..02ed5e6 100755 --- a/sw/AMI/driver/Makefile +++ b/sw/AMI/driver/Makefile @@ -25,20 +25,16 @@ $(TARGET_MODULE)-objs += gcq-driver/src/gcq_driver.o $(TARGET_MODULE)-objs += gcq-driver/src/gcq_hw.o $(TARGET_MODULE)-objs += gcq-driver/src/gcq_features.o -EXTRA_CFLAGS:=-I$(PWD) -I$(PWD)/fal -I$(PWD)/fal/gcq -I$(PWD)/gcq-driver/src +# To apply the macro to all the source files compiled with this makefile +ccflags-y := -I$(src) -I$(src)/fal -I$(src)/fal/gcq -I$(src)/gcq-driver/src +ccflags-y += -DDEBUG -DVERBOSE_DEBUG -DGCQ_MAX_INSTANCES=16 -KERNEL_DIR = /lib/modules/`uname -r`/build - -#CFLAGS_file_name will apply the macros to those files -# CFLAGS_versal_vmc.o:=-DDEBUG - -#To apply the macro to all the source files compiled with this makefile -# ccflags-y:=-DDEBUG -ccflags-y:=-DDEBUG -DVERBOSE_DEBUG -DGCQ_MAX_INSTANCES=16 +KERNEL_DIR ?= /lib/modules/$(shell uname -r)/build +PWD := $(shell pwd) all: clean @test -f ../scripts/getVersion.sh && ../scripts/getVersion.sh driver $(realpath .) || echo "" - $(MAKE) -C ${KERNEL_DIR} M=${PWD} modules + $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules clean: - $(MAKE) -C ${KERNEL_DIR} M=${PWD} clean + $(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean