static int msm8x60_vcm_init(void) { int ret; void *vcm_ebi_base; vcm_ebi_base = __alloc_bootmem(VCM_EBI_SIZE, VCM_EBI_ALIGN, 0); if (!vcm_ebi_base) { pr_err("Could not allocate VCM-managed physical memory\n"); goto fail; } memory[1].addr = __pa(vcm_ebi_base); ret = vcm_sys_init(memory, ARRAY_SIZE(memory), mt_map, ARRAY_SIZE(mt_map), (void *)MSM_SMI_BASE + MSM_SMI_SIZE - SZ_8M, SZ_8M); if (ret != 0) { pr_err("vcm_sys_init() ret %i\n", ret); goto fail; } return 0; fail: return -1; };
static int msm8x60_vcm_init(void) { int ret, i; void *ebi_chunk; for (i = 0; i < ARRAY_SIZE(memory); i++) { if (memory[i].addr == 0) { ebi_chunk = __alloc_bootmem(memory[i].size, memory[i].size, 0); if (!ebi_chunk) { pr_err("Could not allocate VCM-managed physical" " memory\n"); ret = -ENOMEM; goto fail; } memory[i].addr = __pa(ebi_chunk); } } ret = vcm_sys_init(memory, ARRAY_SIZE(memory), mt_map, ARRAY_SIZE(mt_map), (void *)MSM_SMI_BASE + MSM_SMI_SIZE - SZ_8M, SZ_8M); if (ret != 0) { pr_err("vcm_sys_init() ret %i\n", ret); goto fail; } return 0; fail: return ret; };