/* Deselect, release chip lock and wake up anyone waiting on the device  */
static void nand_release_device(struct mtd_info *mtd)
/* Deselect, release chip lock and wake up anyone waiting on the device  */
static void nand_release_device(struct mtd_info *mtd)
{
	struct nand_chip *chip = mtd->priv;
	chip->select_chip(mtd, -1);
	spin_lock(&chip->controller->lock);
	chip->controller->active = NULL;
	chip->state = FL_READY;
	wake_up(&chip->controller->wq);
	spin_unlock(&chip->controller->lock);
}