/* Downcount for deallocation. This rides on two assumptions: */
static void ub_put(struct ub_dev *sc)
/* Downcount for deallocation. This rides on two assumptions: */
static void ub_put(struct ub_dev *sc)
{
	unsigned long flags;
	spin_lock_irqsave(&ub_lock, flags);
	--sc->openc;
	if (sc->openc == 0 && atomic_read(&sc->poison)) {
		spin_unlock_irqrestore(&ub_lock, flags);
		ub_cleanup(sc);
	} else {
		spin_unlock_irqrestore(&ub_lock, flags);
	}
}