在centos7.9.2009精简版中编译ch34x串口驱动出现如题错误,解决方案:
将ch34x.c中的
替换为
重新make clean、make即可,警告可忽略,编译成功如下图。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | [root@192 /opt ]
make -C /lib/modules/3 .10.0-1160.el7.x86_64 /build M= /opt
make [1]: 进入目录“ /usr/src/kernels/3 .10.0-1160.36.2.el7.x86_64”
CC [M] /opt/ch34x .o
/opt/ch34x .c: 在函数‘ch34x_close’中:
/opt/ch34x .c:591:15: 警告:未使用的变量‘wait’ [-Wunused-variable]
wait_queue_t wait;
^
/opt/ch34x .c:590:7: 警告:未使用的变量‘timeout’ [-Wunused-variable]
long timeout;
^
/opt/ch34x .c:589:6: 警告:未使用的变量‘bps’ [-Wunused-variable]
int bps;
^
Building modules, stage 2.
MODPOST 1 modules
CC /opt/ch34x .mod.o
LD [M] /opt/ch34x .ko
make [1]: 离开目录“ /usr/src/kernels/3 .10.0-1160.36.2.el7.x86_64”
|