static int open_mouse(struct inode * inode, struct file * file) { if (request_irq(ATIXL_MOUSE_IRQ, mouse_interrupt, 0, "ATIXL mouse", NULL)) return -EBUSY; ATIXL_MSE_INT_ON(); /* Interrupts are really enabled here */ return 0; }
static int open_mouse(struct inode * inode, struct file * file) { if (!mouse.present) return -EINVAL; if (mouse.active++) return 0; if (request_irq(ATIXL_MOUSE_IRQ, mouse_interrupt, 0, "ATIXL mouse", NULL)) { mouse.active--; return -EBUSY; } mouse.ready = 0; mouse.dx = 0; mouse.dy = 0; mouse.buttons = mouse.latch_buttons = 0; ATIXL_MSE_INT_ON(); /* Interrupts are really enabled here */ MOD_INC_USE_COUNT; return 0; }