/* RETURNS: 0 if devres is found and freed, -ENOENT if not found.  */
int devres_destroy(struct device *dev, dr_release_t release, dr_match_t match, void *match_data)
/* RETURNS: 0 if devres is found and freed, -ENOENT if not found.  */
int devres_destroy(struct device *dev, dr_release_t release, dr_match_t match, void *match_data)
{
	void *res;
	res = devres_remove(dev, release, match, match_data);
	if (unlikely(!res))
		return -ENOENT;
	devres_free(res);
	return 0;
}