Commit 62923806 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Viresh Kumar

cpufreq: s5pv210: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent b89c01c9
...@@ -590,6 +590,7 @@ static struct notifier_block s5pv210_cpufreq_reboot_notifier = { ...@@ -590,6 +590,7 @@ static struct notifier_block s5pv210_cpufreq_reboot_notifier = {
static int s5pv210_cpufreq_probe(struct platform_device *pdev) static int s5pv210_cpufreq_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct device_node *np; struct device_node *np;
int id, result = 0; int id, result = 0;
...@@ -602,21 +603,14 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev) ...@@ -602,21 +603,14 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
* cpufreq-dt driver. * cpufreq-dt driver.
*/ */
arm_regulator = regulator_get(NULL, "vddarm"); arm_regulator = regulator_get(NULL, "vddarm");
if (IS_ERR(arm_regulator)) { if (IS_ERR(arm_regulator))
if (PTR_ERR(arm_regulator) == -EPROBE_DEFER) return dev_err_probe(dev, PTR_ERR(arm_regulator),
pr_debug("vddarm regulator not ready, defer\n"); "failed to get regulator vddarm\n");
else
pr_err("failed to get regulator vddarm\n");
return PTR_ERR(arm_regulator);
}
int_regulator = regulator_get(NULL, "vddint"); int_regulator = regulator_get(NULL, "vddint");
if (IS_ERR(int_regulator)) { if (IS_ERR(int_regulator)) {
if (PTR_ERR(int_regulator) == -EPROBE_DEFER) result = dev_err_probe(dev, PTR_ERR(int_regulator),
pr_debug("vddint regulator not ready, defer\n"); "failed to get regulator vddint\n");
else
pr_err("failed to get regulator vddint\n");
result = PTR_ERR(int_regulator);
goto err_int_regulator; goto err_int_regulator;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment