unsigned int driver_poll(struct file *instance, struct poll_table_struct *event_list) { unsigned int mask = 0; poll_wait(instance, &wq_read, event_list); poll_wait(instance, &wq_write, event_list); if (READ_POSSIBLE) mask |= POLLIN | POLLRDNORM; if (WRITE_POSSIBLE) mask |= POLLOUT | POLLWRNORM; return mask; }