Fix for compilation error for SIS1100 Linux driver under kernel 4.2.x

Used Driver:

sis1100-2.13-9

Error Description:

Building errors:
===============================
CC [M]
/home/daq/Workspace/daq/exaos/eldaq/vme/sis3100/driver/src/sis1100_ddma_map_linux.o
/home/daq/Workspace/daq/exaos/eldaq/vme/sis3100/driver/src/sis1100_ddma_map_linux.c:
In function ‘sis1100_ddma_unmap_block’:
/home/daq/Workspace/daq/exaos/eldaq/vme/sis3100/driver/src/sis1100_ddma_map_linux.c:54:9:
error: implicit declaration of function ‘vfree’
[-Werror=implicit-function-declaration]
vfree(block->desc_pages);
^
/home/daq/Workspace/daq/exaos/eldaq/vme/sis3100/driver/src/sis1100_ddma_map_linux.c:
In function ‘sis1100_ddma_map_block’:
/home/daq/Workspace/daq/exaos/eldaq/vme/sis3100/driver/src/sis1100_ddma_map_linux.c:130:5:
error: implicit declaration of function ‘vmalloc’
[-Werror=implicit-function-declaration]
block->desc_pages=vmalloc(block->dsegs* sizeof(struct sis1100_dmapage));
^
/home/daq/Workspace/daq/exaos/eldaq/vme/sis3100/driver/src/sis1100_ddma_map_linux.c:130:22:
warning: assignment makes pointer from integer without a cast
block->desc_pages=vmalloc(block->dsegs* sizeof(struct sis1100_dmapage));
^

Solution:

Fixing is simple, just add the missing include “#include <linux/vmaclloc.h>” to “compat_linux.h”.
===============================
+++ b/vme/sis3100/driver/src/compat_linux.h
@@ -41,6 +41,7 @@
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/time.h>
+#include <linux/vmalloc.h>
#include <asm/poll.h>
#include <asm/uaccess.h>

Thanks and DKMS option:

Thanks to Exaos Lee from China Institute of Atomic Energy for bringing this to our attention.

Eaxos generated a DKMS version of the 2.13-9 also, which can be emailed to interested parties.

This entry was posted in Driver and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *