diff options
author | Ezequiel Garcia <ezequiel.garcia@imgtec.com> | 2015-07-27 10:00:13 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-09-03 06:08:06 -0400 |
commit | f95ac8558b88a5e9ae2b1d580a5cc55bffa512fa (patch) | |
tree | 39fb589fedf27e5baed8770d3bc94859b8d6a49d /drivers/clocksource/mips-gic-timer.c | |
parent | eb811c73b69f18cefb7a63f22fe07212c6575650 (diff) |
CLOCKSOURCE: mips-gic: Add missing error returns checks
This commit adds the required checks on the functions that return
an error. Some of them are not critical, so only a warning is
printed.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: devicetree@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: James Hartley <James.Hartley@imgtec.com>
Cc: Govindraj Raja <Govindraj.Raja@imgtec.com>
Cc: Damien Horsley <Damien.Horsley@imgtec.com>
Cc: James Hogan <James.Hogan@imgtec.com>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Patchwork: https://patchwork.linux-mips.org/patch/10780/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'drivers/clocksource/mips-gic-timer.c')
-rw-r--r-- | drivers/clocksource/mips-gic-timer.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c index 913585d93466..c4352f078492 100644 --- a/drivers/clocksource/mips-gic-timer.c +++ b/drivers/clocksource/mips-gic-timer.c | |||
@@ -100,12 +100,18 @@ static struct notifier_block gic_cpu_nb = { | |||
100 | 100 | ||
101 | static int gic_clockevent_init(void) | 101 | static int gic_clockevent_init(void) |
102 | { | 102 | { |
103 | int ret; | ||
104 | |||
103 | if (!cpu_has_counter || !gic_frequency) | 105 | if (!cpu_has_counter || !gic_frequency) |
104 | return -ENXIO; | 106 | return -ENXIO; |
105 | 107 | ||
106 | setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction); | 108 | ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction); |
109 | if (ret < 0) | ||
110 | return ret; | ||
107 | 111 | ||
108 | register_cpu_notifier(&gic_cpu_nb); | 112 | ret = register_cpu_notifier(&gic_cpu_nb); |
113 | if (ret < 0) | ||
114 | pr_warn("GIC: Unable to register CPU notifier\n"); | ||
109 | 115 | ||
110 | gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device)); | 116 | gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device)); |
111 | 117 | ||
@@ -125,13 +131,17 @@ static struct clocksource gic_clocksource = { | |||
125 | 131 | ||
126 | static void __init __gic_clocksource_init(void) | 132 | static void __init __gic_clocksource_init(void) |
127 | { | 133 | { |
134 | int ret; | ||
135 | |||
128 | /* Set clocksource mask. */ | 136 | /* Set clocksource mask. */ |
129 | gic_clocksource.mask = CLOCKSOURCE_MASK(gic_get_count_width()); | 137 | gic_clocksource.mask = CLOCKSOURCE_MASK(gic_get_count_width()); |
130 | 138 | ||
131 | /* Calculate a somewhat reasonable rating value. */ | 139 | /* Calculate a somewhat reasonable rating value. */ |
132 | gic_clocksource.rating = 200 + gic_frequency / 10000000; | 140 | gic_clocksource.rating = 200 + gic_frequency / 10000000; |
133 | 141 | ||
134 | clocksource_register_hz(&gic_clocksource, gic_frequency); | 142 | ret = clocksource_register_hz(&gic_clocksource, gic_frequency); |
143 | if (ret < 0) | ||
144 | pr_warn("GIC: Unable to register clocksource\n"); | ||
135 | 145 | ||
136 | gic_clockevent_init(); | 146 | gic_clockevent_init(); |
137 | 147 | ||