/* return_fm_pebs - returns all PEBs used by a fastmap back to the WL sub-system. @ubi: UBI device object @fm: fastmap layout object  */
static void return_fm_pebs(struct ubi_device *ubi, struct ubi_fastmap_layout *fm)
/* return_fm_pebs - returns all PEBs used by a fastmap back to the WL sub-system. @ubi: UBI device object @fm: fastmap layout object  */
static void return_fm_pebs(struct ubi_device *ubi, struct ubi_fastmap_layout *fm)
{
	int i;
	if (!fm)
		return;
	for (i = 0; i < fm->used_blocks; i++) {
		if (fm->e[i]) {
			ubi_wl_put_fm_peb(ubi, fm->e[i], i,
					  fm->to_be_tortured[i]);
			fm->e[i] = NULL;
		}
	}
}