fix module unregister function

git-svn-id: svn+ssh://en.codiert.org/home/staff/ben/dev/misc.svn/projects/fpgafs@352 766a2236-cff9-0310-b0c0-a81a5f92509a
This commit is contained in:
ben 2007-07-06 07:37:25 +00:00
parent 37bc27371a
commit b80cd00633
2 changed files with 9 additions and 5 deletions

View File

@ -8,13 +8,13 @@
static int fpgafs_send_data_dbg(unsigned char *buf, int len) static int fpgafs_send_data_dbg(unsigned char *buf, int len)
{ {
printk("fpgafs: send data CHAM\n"); printk("fpgafs: send data DEBUG\n");
return 0; return 0;
} }
static int fpgafs_recv_data_dbg(unsigned char *buf, int len) static int fpgafs_recv_data_dbg(unsigned char *buf, int len)
{ {
printk("fpgafs: receive data CHAM\n"); printk("fpgafs: receive data DEBUG\n");
return 4; return 4;
} }

View File

@ -60,12 +60,16 @@ int fpgafs_unregister_lldrv(struct fpgafs_lldrv *drv)
spin_lock_irqsave(&fpgafs_lldrv_lock, flags); spin_lock_irqsave(&fpgafs_lldrv_lock, flags);
if (lldrv[lldrv_count]->exit)
lldrv[lldrv_count]->exit();
for(i=0; i < FPGAFS_MAX_LLDRV; i++) { for(i=0; i < FPGAFS_MAX_LLDRV; i++) {
if (lldrv[i] == drv) { if (lldrv[i] == drv) {
/* call the exit function */
if (lldrv[lldrv_count]->exit)
lldrv[lldrv_count]->exit();
lldrv[i] = NULL; lldrv[i] = NULL;
lldrv_cur = NULL;
/* if current, search another low level driver */ /* if current, search another low level driver */
if (lldrv_cur == drv) { if (lldrv_cur == drv) {
for(k=0; k < FPGAFS_MAX_LLDRV; k++) for(k=0; k < FPGAFS_MAX_LLDRV; k++)