diff options
author | Igor Nabirushkin <inabirushkin@nvidia.com> | 2015-02-15 01:08:11 +0400 |
---|---|---|
committer | Winnie Hsu <whsu@nvidia.com> | 2015-05-29 14:24:43 -0700 |
commit | d18306d725e35e6431e04745d97c3a61c0d1280d (patch) | |
tree | 49deda80ac400863cecf8de0474d7a85f9213242 /drivers/misc | |
parent | 73ef5a836aec5c8bee753790e1f6002b7602a342 (diff) |
misc: tegra-profiler: fix return value check
Tegra System Profiler: device is frozen when using clk events.
Fix return value check.
Bug 1611412
Change-Id: Ic9da6f02b222aaf0b3e5e84156103be39a28168b
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/708066
(cherry picked from commit d7f72918dd2c210fd991e61414da3b5f95916f25)
Reviewed-on: http://git-master/r/747748
GVS: Gerrit_Virtual_Submit
Reviewed-by: Andrey Trachenko <atrachenko@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/tegra-profiler/power_clk.c | 22 | ||||
-rw-r--r-- | drivers/misc/tegra-profiler/version.h | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/misc/tegra-profiler/power_clk.c b/drivers/misc/tegra-profiler/power_clk.c index aaa5e5de7779..c3b5aa3596c7 100644 --- a/drivers/misc/tegra-profiler/power_clk.c +++ b/drivers/misc/tegra-profiler/power_clk.c @@ -22,6 +22,7 @@ #include <linux/notifier.h> #include <linux/cpu.h> #include <linux/timer.h> +#include <linux/err.h> #include <linux/tegra_profiler.h> @@ -92,7 +93,7 @@ static void read_source(struct power_clk_source *s) case QUADD_POWER_CLK_GPU: /* update gpu frequency */ s->clkp = clk_get_sys("3d", NULL); - if (s->clkp) { + if (!IS_ERR_OR_NULL(s->clkp)) { s->data[0].value = clk_get_rate(s->clkp) / 1000; clk_put(s->clkp); @@ -102,7 +103,7 @@ static void read_source(struct power_clk_source *s) case QUADD_POWER_CLK_EMC: /* update emc frequency */ s->clkp = clk_get_sys("cpu", "emc"); - if (s->clkp) { + if (!IS_ERR_OR_NULL(s->clkp)) { s->data[0].value = clk_get_rate(s->clkp) / 1000; clk_put(s->clkp); @@ -332,38 +333,40 @@ int quadd_power_clk_start(void) /* setup gpu frequency */ s = &power_ctx.gpu; s->clkp = clk_get_sys("3d", NULL); - if (s->clkp) { + if (!IS_ERR_OR_NULL(s->clkp)) { #ifdef CONFIG_COMMON_CLK status = clk_notifier_register(s->clkp, s->nb); if (status < 0) { pr_err("error: could not setup gpu freq\n"); + clk_put(s->clkp); return status; } - clk_put(s->clkp); #endif + clk_put(s->clkp); reset_data(s); atomic_set(&s->active, 1); } else { - pr_err("error: could not setup gpu freq\n"); + pr_warn("warning: could not setup gpu freq\n"); atomic_set(&s->active, 0); } /* setup emc frequency */ s = &power_ctx.emc; s->clkp = clk_get_sys("cpu", "emc"); - if (s->clkp) { + if (!IS_ERR_OR_NULL(s->clkp)) { #ifdef CONFIG_COMMON_CLK status = clk_notifier_register(s->clkp, s->nb); if (status < 0) { pr_err("error: could not setup emc freq\n"); + clk_put(s->clkp); return status; } - clk_put(s->clkp); #endif + clk_put(s->clkp); reset_data(s); atomic_set(&s->active, 1); } else { - pr_err("error: could not setup emc freq\n"); + pr_warn("warning: could not setup emc freq\n"); atomic_set(&s->active, 0); } @@ -424,8 +427,6 @@ void quadd_power_clk_stop(void) int quadd_power_clk_init(struct quadd_ctx *quadd_ctx) { - pr_info("power_clk: init\n"); - init_source(&power_ctx.cpu, cpu_notifier_call, nr_cpu_ids, QUADD_POWER_CLK_CPU); init_source(&power_ctx.gpu, gpu_notifier_call, 1, QUADD_POWER_CLK_GPU); @@ -438,6 +439,5 @@ int quadd_power_clk_init(struct quadd_ctx *quadd_ctx) void quadd_power_clk_deinit(void) { - pr_info("power_clk: deinit\n"); quadd_power_clk_stop(); } diff --git a/drivers/misc/tegra-profiler/version.h b/drivers/misc/tegra-profiler/version.h index 2211061c9f69..2281ec87dbbb 100644 --- a/drivers/misc/tegra-profiler/version.h +++ b/drivers/misc/tegra-profiler/version.h @@ -18,7 +18,7 @@ #ifndef __QUADD_VERSION_H #define __QUADD_VERSION_H -#define QUADD_MODULE_VERSION "1.90" +#define QUADD_MODULE_VERSION "1.91" #define QUADD_MODULE_BRANCH "Dev" #endif /* __QUADD_VERSION_H */ |