diff --git a/fpgafs_lldrv_dbg.c b/fpgafs_lldrv_dbg.c index 8d437cc..b89c47e 100644 --- a/fpgafs_lldrv_dbg.c +++ b/fpgafs_lldrv_dbg.c @@ -8,13 +8,13 @@ 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; } 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; } diff --git a/llmgmt.c b/llmgmt.c index 2369721..4096c43 100644 --- a/llmgmt.c +++ b/llmgmt.c @@ -60,12 +60,16 @@ int fpgafs_unregister_lldrv(struct fpgafs_lldrv *drv) spin_lock_irqsave(&fpgafs_lldrv_lock, flags); - if (lldrv[lldrv_count]->exit) - lldrv[lldrv_count]->exit(); - for(i=0; i < FPGAFS_MAX_LLDRV; i++) { if (lldrv[i] == drv) { + + /* call the exit function */ + if (lldrv[lldrv_count]->exit) + lldrv[lldrv_count]->exit(); + lldrv[i] = NULL; + lldrv_cur = NULL; + /* if current, search another low level driver */ if (lldrv_cur == drv) { for(k=0; k < FPGAFS_MAX_LLDRV; k++)