/* Release all resources associated with @dev. This function is called on driver detach.  */
int devres_release_all(struct device *dev)
/* Release all resources associated with @dev. This function is called on driver detach.  */
int devres_release_all(struct device *dev)
{
	unsigned long flags;
	if (WARN_ON(dev->devres_head.next == NULL))
		return -ENODEV;
	spin_lock_irqsave(&dev->devres_lock, flags);
	return release_nodes(dev, dev->devres_head.next, &dev->devres_head,
			     flags);
}