Skip to content

Commit f95ac85

Browse files
Ezequiel Garciaralfbaechle
authored andcommitted
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>
1 parent eb811c7 commit f95ac85

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

drivers/clocksource/mips-gic-timer.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,18 @@ static struct notifier_block gic_cpu_nb = {
100100

101101
static int gic_clockevent_init(void)
102102
{
103+
int ret;
104+
103105
if (!cpu_has_counter || !gic_frequency)
104106
return -ENXIO;
105107

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;
107111

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");
109115

110116
gic_clockevent_cpu_init(this_cpu_ptr(&gic_clockevent_device));
111117

@@ -125,13 +131,17 @@ static struct clocksource gic_clocksource = {
125131

126132
static void __init __gic_clocksource_init(void)
127133
{
134+
int ret;
135+
128136
/* Set clocksource mask. */
129137
gic_clocksource.mask = CLOCKSOURCE_MASK(gic_get_count_width());
130138

131139
/* Calculate a somewhat reasonable rating value. */
132140
gic_clocksource.rating = 200 + gic_frequency / 10000000;
133141

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");
135145

136146
gic_clockevent_init();
137147

0 commit comments

Comments
 (0)