/* Wake up users waiting for IO so they can disconnect from dead device.  */
static void joydev_hangup(struct joydev *joydev)
/* Wake up users waiting for IO so they can disconnect from dead device.  */
static void joydev_hangup(struct joydev *joydev)
{
	struct joydev_client *client;
	spin_lock(&joydev->client_lock);
	list_for_each_entry(client, &joydev->client_list, node)
		kill_fasync(&client->fasync, SIGIO, POLL_HUP);
	spin_unlock(&joydev->client_lock);
	wake_up_interruptible(&joydev->wait);
}