/* Returns zero if volumes are all right and a a negative error code if not.  */
static int self_check_volumes(struct ubi_device *ubi)
/* Returns zero if volumes are all right and a a negative error code if not.  */
static int self_check_volumes(struct ubi_device *ubi)
{
	int i, err = 0;
	if (!ubi_dbg_chk_gen(ubi))
		return 0;
	for (i = 0; i < ubi->vtbl_slots; i++) {
		err = self_check_volume(ubi, i);
		if (err)
			break;
	}
	return err;
}