From: Jia-Wei Chang Date: Fri, 22 Apr 2022 07:52:33 +0000 (+0800) Subject: cpufreq: mediatek: Make sram regulator optional X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ffa7bdf7f344477ad817504c87d8d2db5316a8b6;p=linux.git cpufreq: mediatek: Make sram regulator optional For some MediaTek SoCs, like MT8186, it's possible that the sram regulator is shared between CPU and CCI. We hope regulator framework can return error for error handling rather than a dummy handler from regulator_get api. Therefore, we choose to use regulator_get_optional. Signed-off-by: Jia-Wei Chang Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Viresh Kumar --- diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 1688cf68849cb..bcabb3726a5be 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -352,7 +352,7 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) } /* Both presence and absence of sram regulator are valid cases. */ - info->sram_reg = regulator_get_exclusive(cpu_dev, "sram"); + info->sram_reg = regulator_get_optional(cpu_dev, "sram"); if (IS_ERR(info->sram_reg)) info->sram_reg = NULL; else {