/* Register devres @res to @dev. @res should have been allocated using devres_alloc(). On driver detach, the associated release function will be invoked and devres will be freed automatically.  */
void devres_add(struct device *dev, void *res)
/* Register devres @res to @dev. @res should have been allocated using devres_alloc(). On driver detach, the associated release function will be invoked and devres will be freed automatically.  */
void devres_add(struct device *dev, void *res)
{
	struct devres *dr = container_of(res, struct devres, data);
	unsigned long flags;
	spin_lock_irqsave(&dev->devres_lock, flags);
	add_dr(dev, &dr->node);
	spin_unlock_irqrestore(&dev->devres_lock, flags);
}