aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/traps.c
diff options
context:
space:
mode:
authoranton@samba.org <anton@samba.org>2007-03-20 21:38:12 -0400
committerPaul Mackerras <paulus@samba.org>2007-03-25 22:34:29 -0400
commit6031d9d9ad905b514bf45572bd1877fe6b5145ab (patch)
tree8562f0e11b1af2827625002bc7f672d8a66189b1 /arch/powerpc/kernel/traps.c
parent293e4688fe2fec87fccf84a3b1100b27191424e9 (diff)
[POWERPC] Clean up pmac_backlight_unblank in oops path
Move pmac_backlight_unblank into its own function and only take the pmac_backlight_mutex when we are on a pmac for that added bit of paranoia. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r--arch/powerpc/kernel/traps.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 23f43b44bba6..6297da743db9 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -90,6 +90,24 @@ EXPORT_SYMBOL(unregister_die_notifier);
90 * Trap & Exception support 90 * Trap & Exception support
91 */ 91 */
92 92
93#ifdef CONFIG_PMAC_BACKLIGHT
94static void pmac_backlight_unblank(void)
95{
96 mutex_lock(&pmac_backlight_mutex);
97 if (pmac_backlight) {
98 struct backlight_properties *props;
99
100 props = &pmac_backlight->props;
101 props->brightness = props->max_brightness;
102 props->power = FB_BLANK_UNBLANK;
103 backlight_update_status(pmac_backlight);
104 }
105 mutex_unlock(&pmac_backlight_mutex);
106}
107#else
108static inline void pmac_backlight_unblank(void) { }
109#endif
110
93static DEFINE_SPINLOCK(die_lock); 111static DEFINE_SPINLOCK(die_lock);
94 112
95int die(const char *str, struct pt_regs *regs, long err) 113int die(const char *str, struct pt_regs *regs, long err)
@@ -104,18 +122,9 @@ int die(const char *str, struct pt_regs *regs, long err)
104 console_verbose(); 122 console_verbose();
105 spin_lock_irq(&die_lock); 123 spin_lock_irq(&die_lock);
106 bust_spinlocks(1); 124 bust_spinlocks(1);
107#ifdef CONFIG_PMAC_BACKLIGHT 125 if (machine_is(powermac))
108 mutex_lock(&pmac_backlight_mutex); 126 pmac_backlight_unblank();
109 if (machine_is(powermac) && pmac_backlight) {
110 struct backlight_properties *props;
111 127
112 props = &pmac_backlight->props;
113 props->brightness = props->max_brightness;
114 props->power = FB_BLANK_UNBLANK;
115 backlight_update_status(pmac_backlight);
116 }
117 mutex_unlock(&pmac_backlight_mutex);
118#endif
119 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); 128 printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
120#ifdef CONFIG_PREEMPT 129#ifdef CONFIG_PREEMPT
121 printk("PREEMPT "); 130 printk("PREEMPT ");