static int __init exynos4_asv_init(void) { int ret = -EINVAL; exynos_asv = kzalloc(sizeof(struct samsung_asv), GFP_KERNEL); if (!exynos_asv) { ret = -ENOMEM; goto out1; } if (soc_is_exynos4210()) ret = exynos4210_asv_init(exynos_asv); else if (soc_is_exynos4412() || soc_is_exynos4212()) { ret = exynos4x12_asv_init(exynos_asv); /* * If return value is not zero, * There is already value for asv group. * So, It is not necessary to execute for getting asv group. */ if (ret) { kfree(exynos_asv); return 0; } } else if (soc_is_exynos5250()) { ret = exynos5250_asv_init(exynos_asv); if (ret) return 0; } else { pr_info("EXYNOS: There is no type for ASV\n"); goto out2; } if (exynos_asv->check_vdd_arm) { if (exynos_asv->check_vdd_arm()) { pr_info("EXYNOS: It is wrong vdd_arm\n"); goto out2; } } /* Get HPM Delay value */ if (exynos_asv->get_hpm) { if (exynos_asv->get_hpm(exynos_asv)) { pr_info("EXYNOS: Fail to get HPM Value\n"); goto out2; } } else { pr_info("EXYNOS: Fail to get HPM Value\n"); goto out2; } /* Get IDS ARM Value */ if (exynos_asv->get_ids) { if (exynos_asv->get_ids(exynos_asv)) { pr_info("EXYNOS: Fail to get IDS Value\n"); goto out2; } } else { pr_info("EXYNOS: Fail to get IDS Value\n"); goto out2; } if (exynos_asv->store_result) { if (exynos_asv->store_result(exynos_asv)) { pr_info("EXYNOS: Can not success to store result\n"); goto out2; } } else { pr_info("EXYNOS: No store_result function\n"); goto out2; } return 0; out2: kfree(exynos_asv); out1: return ret; }
static int __init exynos4_asv_init(void) { int ret = -EINVAL; exynos_asv = kzalloc(sizeof(struct samsung_asv), GFP_KERNEL); if (!exynos_asv) goto out1; if (soc_is_exynos4210()) ret = exynos4210_asv_init(exynos_asv); else if (soc_is_exynos4412() || soc_is_exynos4212()) { ret = exynos4x12_asv_init(exynos_asv); /* add by cym 20130710 */ #if defined(CONFIG_CPU_TYPE_SCP_ELITE) || defined(CONFIG_CPU_TYPE_SCP_SUPPER) || defined(CONFIG_CPU_TYPE_POP2G_ELITE) || defined(CONFIG_CPU_TYPE_POP2G_SUPPER) /* * If return value is not zero, * There is already value for asv group. * So, It is not necessary to execute for getting asv group. */ if (ret) return 0; #endif /* end add */ } else { pr_info("EXYNOS: There is no type for ASV\n"); goto out2; } if (exynos_asv->check_vdd_arm) { if (exynos_asv->check_vdd_arm()) { pr_info("EXYNOS: It is wrong vdd_arm\n"); goto out2; } } /* Get HPM Delay value */ if (exynos_asv->get_hpm) { if (exynos_asv->get_hpm(exynos_asv)) { pr_info("EXYNOS: Fail to get HPM Value\n"); goto out2; } } else { pr_info("EXYNOS: Fail to get HPM Value\n"); goto out2; } /* Get IDS ARM Value */ if (exynos_asv->get_ids) { if (exynos_asv->get_ids(exynos_asv)) { pr_info("EXYNOS: Fail to get IDS Value\n"); goto out2; } } else { pr_info("EXYNOS: Fail to get IDS Value\n"); goto out2; } if (exynos_asv->store_result) { if (exynos_asv->store_result(exynos_asv)) { pr_info("EXYNOS: Can not success to store result\n"); goto out2; } } else { pr_info("EXYNOS: No store_result function\n"); goto out2; } return 0; out2: kfree(exynos_asv); out1: return -EINVAL; }
static int __init exynos4_asv_init(void) { int ret = -EINVAL; exynos_asv = kzalloc(sizeof(struct samsung_asv), GFP_KERNEL); if (!exynos_asv) goto out1; if (soc_is_exynos4412() || soc_is_exynos4212()) ret = exynos4x12_asv_init(exynos_asv); else { pr_info("EXYNOS: There is no type for ASV\n"); goto out2; } if (exynos_asv->check_vdd_arm) { if (exynos_asv->check_vdd_arm()) { pr_info("EXYNOS: It is wrong vdd_arm\n"); goto out2; } } /* Get HPM Delay value */ if (exynos_asv->get_hpm) { if (exynos_asv->get_hpm(exynos_asv)) { pr_info("EXYNOS: Fail to get HPM Value\n"); goto out2; } } else { pr_info("EXYNOS: Fail to get HPM Value\n"); goto out2; } /* Get IDS ARM Value */ if (exynos_asv->get_ids) { if (exynos_asv->get_ids(exynos_asv)) { pr_info("EXYNOS: Fail to get IDS Value\n"); goto out2; } } else { pr_info("EXYNOS: Fail to get IDS Value\n"); goto out2; } if (exynos_asv->store_result) { if (exynos_asv->store_result(exynos_asv)) { pr_info("EXYNOS: Can not success to store result\n"); goto out2; } } else { pr_info("EXYNOS: No store_result function\n"); goto out2; } kfree(exynos_asv); return 0; out2: kfree(exynos_asv); out1: return -EINVAL; }