aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/leds-h2p2-debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/leds-h2p2-debug.c')
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c13
1 files changed, 8 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..6f958aec9459 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -14,6 +14,7 @@
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/platform_data/gpio-omap.h>
17 18
18#include <mach/hardware.h> 19#include <mach/hardware.h>
19#include <asm/leds.h> 20#include <asm/leds.h>
@@ -68,11 +69,13 @@ void h2p2_dbg_leds_event(led_event_t evt)
68 gpio_set_value(GPIO_IDLE, 0); 69 gpio_set_value(GPIO_IDLE, 0);
69 } 70 }
70 71
71 __raw_writew(~0, &fpga->leds);
72 led_state &= ~LED_STATE_ENABLED; 72 led_state &= ~LED_STATE_ENABLED;
73 if (evt == led_halted) { 73 if (fpga) {
74 iounmap(fpga); 74 __raw_writew(~0, &fpga->leds);
75 fpga = NULL; 75 if (evt == led_halted) {
76 iounmap(fpga);
77 fpga = NULL;
78 }
76 } 79 }
77 80
78 goto done; 81 goto done;
@@ -158,7 +161,7 @@ void h2p2_dbg_leds_event(led_event_t evt)
158 /* 161 /*
159 * Actually burn the LEDs 162 * Actually burn the LEDs
160 */ 163 */
161 if (led_state & LED_STATE_ENABLED) 164 if (led_state & LED_STATE_ENABLED && fpga)
162 __raw_writew(~hw_led_state, &fpga->leds); 165 __raw_writew(~hw_led_state, &fpga->leds);
163 166
164done: 167done: