cpufreq: exynos: Use dev_err/info function instead of pr_err/info
authorChanwoo Choi <cw00.choi@samsung.com>
Fri, 18 Apr 2014 02:20:33 +0000 (11:20 +0900)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Apr 2014 23:00:39 +0000 (01:00 +0200)
This patch uses dev_err/info function to show accurate log message
with device name instead of pr_err/info function.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/exynos-cpufreq.c
drivers/cpufreq/exynos-cpufreq.h

index 9c132550d9106f1dbe13227db7aa39f604def58b..c3e55aa28cf87de7da5bbad69ff74f2385578f84 100644 (file)
@@ -48,6 +48,7 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
        struct cpufreq_policy *policy = cpufreq_cpu_get(0);
        unsigned int arm_volt, safe_arm_volt = 0;
        unsigned int mpll_freq_khz = exynos_info->mpll_freq_khz;
+       struct device *dev = exynos_info->dev;
        unsigned int old_freq;
        int index, old_index;
        int ret = 0;
@@ -89,8 +90,8 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
                /* Firstly, voltage up to increase frequency */
                ret = regulator_set_voltage(arm_regulator, arm_volt, arm_volt);
                if (ret) {
-                       pr_err("%s: failed to set cpu voltage to %d\n",
-                               __func__, arm_volt);
+                       dev_err(dev, "failed to set cpu voltage to %d\n",
+                               arm_volt);
                        return ret;
                }
        }
@@ -99,8 +100,8 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
                ret = regulator_set_voltage(arm_regulator, safe_arm_volt,
                                      safe_arm_volt);
                if (ret) {
-                       pr_err("%s: failed to set cpu voltage to %d\n",
-                               __func__, safe_arm_volt);
+                       dev_err(dev, "failed to set cpu voltage to %d\n",
+                               safe_arm_volt);
                        return ret;
                }
        }
@@ -114,8 +115,8 @@ static int exynos_cpufreq_scale(unsigned int target_freq)
                ret = regulator_set_voltage(arm_regulator, arm_volt,
                                arm_volt);
                if (ret) {
-                       pr_err("%s: failed to set cpu voltage to %d\n",
-                               __func__, arm_volt);
+                       dev_err(dev, "failed to set cpu voltage to %d\n",
+                               arm_volt);
                        goto out;
                }
        }
@@ -162,6 +163,8 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
        if (!exynos_info)
                return -ENOMEM;
 
+       exynos_info->dev = &pdev->dev;
+
        if (soc_is_exynos4210())
                ret = exynos4210_cpufreq_init(exynos_info);
        else if (soc_is_exynos4212() || soc_is_exynos4412())
@@ -175,13 +178,13 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
                goto err_vdd_arm;
 
        if (exynos_info->set_freq == NULL) {
-               pr_err("%s: No set_freq function (ERR)\n", __func__);
+               dev_err(&pdev->dev, "No set_freq function (ERR)\n");
                goto err_vdd_arm;
        }
 
        arm_regulator = regulator_get(NULL, "vdd_arm");
        if (IS_ERR(arm_regulator)) {
-               pr_err("%s: failed to get resource vdd_arm\n", __func__);
+               dev_err(&pdev->dev, "failed to get resource vdd_arm\n");
                goto err_vdd_arm;
        }
 
@@ -191,7 +194,7 @@ static int exynos_cpufreq_probe(struct platform_device *pdev)
        if (!cpufreq_register_driver(&exynos_driver))
                return 0;
 
-       pr_err("%s: failed to register cpufreq driver\n", __func__);
+       dev_err(&pdev->dev, "failed to register cpufreq driver\n");
        regulator_put(arm_regulator);
 err_vdd_arm:
        kfree(exynos_info);
index 3ddade8a51251e31a2091642aa9e6c4d76e3f398..b72ff10a040ef1ddebf73d7d57aec7eddb1b94ca 100644 (file)
@@ -34,6 +34,7 @@ struct apll_freq {
 };
 
 struct exynos_dvfs_info {
+       struct device   *dev;
        unsigned long   mpll_freq_khz;
        unsigned int    pll_safe_idx;
        struct clk      *cpu_clk;