/** * @brief User entry point in driver/simulator unistall routine. * * @param proceed -- if standard code execution should be proceed * @param sptr -- statics table pointer * * It's up to user to set kernel-level errno (by means of @e pseterr call). * @e proceed parameter denotes if further standard actions should be proceed * after function returns. @b FALSE - means that user-desired operation done * all that user wants and there is no further necessaty to perfom any standard * operations that follow function call. @b TRUE - means that code that follows * function call will be executed. * * @return return value is the same as in entry point function.\n * OK - if succeed.\n * SYSERR - in case of failure. */ int GfaschannelUserUnInst(int *proceed, GFASCHANNELStatics_t *sptr) { GFASCHANNELUserStatics_t *usp; /* user statistics table */ usp = sptr->usrst; /* Uncomment the following code to unregister ISR */ #if 0 kkprintf("Gfaschannel: Interrupt routine managment" " cleanup ( vector number [%d] ) - ", sptr->info->iVector); #ifdef __Lynx__ #ifdef __powerpc__ /* in this case we are using CES BSP */ vme_intclr(sptr->info->iVector, 0); #else iointclr(sptr->info->iVector); #endif #else /* __linux__ */ vme_free_irq(sptr->info->iVector); #endif /* __Lynx__ */ kkprintf("OK\n"); #endif if (proceed) *proceed = TRUE; /* continue standard code execution */ return OK; /* succeed */ }
/** * @brief User entry point in driver/simulator unistall routine. * * @param proceed -- if standard code execution should be proceed * @param sptr -- statics table pointer * * It's up to user to set kernel-level errno (by means of @e pseterr call). * @e proceed parameter denotes if further standard actions should be proceed * after function returns. @b FALSE - means that user-desired operation done * all that user wants and there is no further necessaty to perfom any standard * operations that follow function call. @b TRUE - means that code that follows * function call will be executed. * * @return return value is the same as in entry point function.\n * OK - if succeed.\n * SYSERR - in case of failure. */ int CvorbUserUnInst(int *proceed, CVORBStatics_t *sptr) { //CVORBUserStatics_t *usp = sptr->usrst; /* user statistics table */ /* Uncomment the following code to unregister ISR */ #if 0 kkprintf("Cvorb: Interrupt routine managment" " cleanup ( vector number [%d] ) - ", sptr->info->iVector); #ifdef __Lynx__ #ifdef __powerpc__ /* in this case we are using CES BSP */ vme_intclr(sptr->info->iVector, 0); #else iointclr(sptr->info->iVector); #endif #else /* __linux__ */ vme_free_irq(sptr->info->iVector); #endif /* __Lynx__ */ kkprintf("OK\n"); #endif sysfree((char*)sptr->usrst->md, sizeof(_m)); if (proceed) *proceed = TRUE; /* continue standard code execution */ return OK; /* succeed */ }
static int tvme200_free_irq_slot(struct tvme200_board *tvme200, int slot) { struct slot_irq *slot_irq; int err; if (tvme200 == NULL) return -EINVAL; if (mutex_lock_interruptible(&tvme200->mutex)) return -ERESTARTSYS; if (tvme200->slots[slot].irq == NULL) { mutex_unlock(&tvme200->mutex); return -EINVAL; } slot_irq = tvme200->slots[slot].irq; err = vme_free_irq(slot_irq->vector); if (!err) dev_info(tvme200->info->dev, "slot %d irq vector 0x%x freed\n", slot, slot_irq->vector); else dev_info(tvme200->info->dev, "error: slot %d irq vector 0x%x can not be freed\n", slot, slot_irq->vector); kfree(slot_irq); mutex_unlock(&tvme200->mutex); return 0; }
void unregister_module(struct vmeio_device *dev) { if (dev->vector) vme_free_irq(dev->vector); if (dev->maps[0].kernel_va) vme_release_mapping(&dev->maps[0], 1); if (dev->maps[1].kernel_va) vme_release_mapping(&dev->maps[1], 1); }
void ctrirq_exit(void) { DisableCtrInterrupt(); DisableCtrModule(); if (vme_free_irq(CTR_IRQ_VECTOR)) printk(KERN_WARNING PFX "Failed to free irq\n"); if (vme_release_mapping(&ctr_desc, 1) != 0) printk(KERN_WARNING PFX "Failed to release mapping\n"); }