/* This function frees all resources for volume @vol but does not remove it. Used only when the UBI device is detached.  */
void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
/* This function frees all resources for volume @vol but does not remove it. Used only when the UBI device is detached.  */
void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
{
	dbg_gen("free volume %d", vol->vol_id);
	ubi->volumes[vol->vol_id] = NULL;
	cdev_del(&vol->cdev);
	device_unregister(&vol->dev);
}