diff options
Diffstat (limited to 'arch/arm/mach-omap1/leds-h2p2-debug.c')
-rw-r--r-- | arch/arm/mach-omap1/leds-h2p2-debug.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c index f6b14a14a957..78acaa9f4fd9 100644 --- a/arch/arm/mach-omap1/leds-h2p2-debug.c +++ b/arch/arm/mach-omap1/leds-h2p2-debug.c | |||
@@ -68,11 +68,13 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
68 | gpio_set_value(GPIO_IDLE, 0); | 68 | gpio_set_value(GPIO_IDLE, 0); |
69 | } | 69 | } |
70 | 70 | ||
71 | __raw_writew(~0, &fpga->leds); | ||
72 | led_state &= ~LED_STATE_ENABLED; | 71 | led_state &= ~LED_STATE_ENABLED; |
73 | if (evt == led_halted) { | 72 | if (fpga) { |
74 | iounmap(fpga); | 73 | __raw_writew(~0, &fpga->leds); |
75 | fpga = NULL; | 74 | if (evt == led_halted) { |
75 | iounmap(fpga); | ||
76 | fpga = NULL; | ||
77 | } | ||
76 | } | 78 | } |
77 | 79 | ||
78 | goto done; | 80 | goto done; |
@@ -158,7 +160,7 @@ void h2p2_dbg_leds_event(led_event_t evt) | |||
158 | /* | 160 | /* |
159 | * Actually burn the LEDs | 161 | * Actually burn the LEDs |
160 | */ | 162 | */ |
161 | if (led_state & LED_STATE_ENABLED) | 163 | if (led_state & LED_STATE_ENABLED && fpga) |
162 | __raw_writew(~hw_led_state, &fpga->leds); | 164 | __raw_writew(~hw_led_state, &fpga->leds); |
163 | 165 | ||
164 | done: | 166 | done: |