Skip to content

Commit

Permalink
[POWERPC] Clean up pmac_backlight_unblank in oops path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
anton@samba.org authored and Paul Mackerras committed Mar 26, 2007
1 parent 293e468 commit 6031d9d
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@ EXPORT_SYMBOL(unregister_die_notifier);
* 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);

int die(const char *str, struct pt_regs *regs, long err)
Expand All @@ -104,18 +122,9 @@ int die(const char *str, struct pt_regs *regs, long err)
console_verbose();
spin_lock_irq(&die_lock);
bust_spinlocks(1);
#ifdef CONFIG_PMAC_BACKLIGHT
mutex_lock(&pmac_backlight_mutex);
if (machine_is(powermac) && pmac_backlight) {
struct backlight_properties *props;
if (machine_is(powermac))
pmac_backlight_unblank();

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);
#ifdef CONFIG_PREEMPT
printk("PREEMPT ");
Expand Down

0 comments on commit 6031d9d

Please sign in to comment.