我正在尝试移植https://github.com/kenballus/fl2000_drm_519,专为 linux 5.19 设计,适用于 linux 6.2.11,但在应用下面附加的补丁后,我收到此错误,但我不知道如何修复它:
$ make
make CHECK="/usr/bin/sparse" -C /lib/modules/6.2.11-300.fc38.x86_64/build M=/home/guillem/Downloads/fl2000_drm_519 modules
make[1]: Entering directory '/usr/src/kernels/6.2.11-300.fc38.x86_64'
MODPOST /home/guillem/Downloads/fl2000_drm_519/Module.symvers
ERROR: modpost: module fl2000 uses symbol dma_buf_end_cpu_access from namespace DMA_BUF, but does not import it.
ERROR: modpost: module fl2000 uses symbol dma_buf_begin_cpu_access from namespace DMA_BUF, but does not import it.
make[2]: *** [scripts/Makefile.modpost:138: /home/guillem/Downloads/fl2000_drm_519/Module.symvers] Error 1
make[1]: *** [Makefile:1977: modpost] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.2.11-300.fc38.x86_64'
make: *** [Makefile:21: modules] Error 2
我已经修补了fl2000.h
这种方式来解决其他导入错误:
diff --git a/fl2000.h b/fl2000.h
index 718e247..c4a6910 100644
--- a/fl2000.h
+++ b/fl2000.h
@@ -23,6 +23,7 @@
#include <linux/dma-mapping.h>
#include <linux/time.h>
#include <linux/device.h>
+#include <linux/dma-buf.h>
#include <drm/drm_gem.h>
#include <drm/drm_prime.h>
#include <drm/drm_vblank.h>
@@ -37,6 +38,8 @@
#include <drm/drm_probe_helper.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_framebuffer.h>
+#include <drm/drm_fbdev_generic.h>
#include "fl2000_registers.h"
答案1
正如错误所示,您需要导入该名称空间。
适当的补丁是:
diff --git a/fl2000_drv.c b/fl2000_drv.c
index 31b7ef4..218b87a 100644
--- a/fl2000_drv.c
+++ b/fl2000_drv.c
@@ -195,3 +195,4 @@ module_usb_driver(fl2000_driver);
MODULE_AUTHOR("Artem Mygaiev");
MODULE_DESCRIPTION("FL2000 USB display driver");
MODULE_LICENSE("GPL v2");
+MODULE_IMPORT_NS(DMA_BUF);