/* Tape device release function used by tape_char & tape_block frontends.  */
int tape_release(struct tape_device *device)
/* Tape device release function used by tape_char & tape_block frontends.  */
int tape_release(struct tape_device *device)
{
	spin_lock_irq(get_ccwdev_lock(device->cdev));
	if (device->tape_state == TS_IN_USE)
		tape_state_set(device, TS_UNUSED);
	module_put(device->discipline->owner);
	spin_unlock_irq(get_ccwdev_lock(device->cdev));
	return 0;
}