提交 6031d9d9 编写于 作者: A anton@samba.org 提交者: Paul Mackerras

[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: NAnton Blanchard <anton@samba.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 293e4688
...@@ -90,6 +90,24 @@ EXPORT_SYMBOL(unregister_die_notifier); ...@@ -90,6 +90,24 @@ EXPORT_SYMBOL(unregister_die_notifier);
* Trap & Exception support * Trap & Exception support
*/ */
#ifdef CONFIG_PMAC_BACKLIGHT
static void pmac_backlight_unblank(void)
{
mutex_lock(&pmac_backlight_mutex);
if (pmac_backlight) {
struct backlight_properties *props;
props = &pmac_backlight->props;
props->brightness = props->max_brightness;
props->power = FB_BLANK_UNBLANK;
backlight_update_status(pmac_backlight);
}
mutex_unlock(&pmac_backlight_mutex);
}
#else
static inline void pmac_backlight_unblank(void) { }
#endif
static DEFINE_SPINLOCK(die_lock); static DEFINE_SPINLOCK(die_lock);
int die(const char *str, struct pt_regs *regs, long err) int 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,18 +122,9 @@ int die(const char *str, struct pt_regs *regs, long err)
console_verbose(); console_verbose();
spin_lock_irq(&die_lock); spin_lock_irq(&die_lock);
bust_spinlocks(1); bust_spinlocks(1);
#ifdef CONFIG_PMAC_BACKLIGHT if (machine_is(powermac))
mutex_lock(&pmac_backlight_mutex); pmac_backlight_unblank();
if (machine_is(powermac) && pmac_backlight) {
struct backlight_properties *props;
props = &pmac_backlight->props;
props->brightness = props->max_brightness;
props->power = FB_BLANK_UNBLANK;
backlight_update_status(pmac_backlight);
}
mutex_unlock(&pmac_backlight_mutex);
#endif
printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter);
#ifdef CONFIG_PREEMPT #ifdef CONFIG_PREEMPT
printk("PREEMPT "); printk("PREEMPT ");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册