diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-01-17 16:14:01 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-02-07 08:30:22 -0500 |
commit | 9414d3628abb646834965b6c23b8e9064729b110 (patch) | |
tree | 7169a54a5b8e2aab003b3bcfbe60de5169400edc /arch/mips/kernel | |
parent | a3305a8835ed039363822523a3cac24e990083dc (diff) |
[MIPS] Check function pointers are non-zero before calling.
Several boards don't initialize the pointers, so let's play safe.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/reset.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/mips/kernel/reset.c b/arch/mips/kernel/reset.c index ae2ba67b7ef6..a131aa0cbe66 100644 --- a/arch/mips/kernel/reset.c +++ b/arch/mips/kernel/reset.c | |||
@@ -23,16 +23,18 @@ void (*_machine_power_off)(void); | |||
23 | 23 | ||
24 | void machine_restart(char *command) | 24 | void machine_restart(char *command) |
25 | { | 25 | { |
26 | _machine_restart(command); | 26 | if (_machine_restart) |
27 | _machine_restart(command); | ||
27 | } | 28 | } |
28 | 29 | ||
29 | void machine_halt(void) | 30 | void machine_halt(void) |
30 | { | 31 | { |
31 | _machine_halt(); | 32 | if (_machine_halt) |
33 | _machine_halt(); | ||
32 | } | 34 | } |
33 | 35 | ||
34 | void machine_power_off(void) | 36 | void machine_power_off(void) |
35 | { | 37 | { |
36 | _machine_power_off(); | 38 | if (_machine_power_off) |
39 | _machine_power_off(); | ||
37 | } | 40 | } |
38 | |||