diff options
Diffstat (limited to 'arch/arm/mach-omap1/leds-h2p2-debug.c')
| -rw-r--r-- | arch/arm/mach-omap1/leds-h2p2-debug.c | 13 | 
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 f6b14a14a95..6f958aec945 100644 --- a/arch/arm/mach-omap1/leds-h2p2-debug.c +++ b/arch/arm/mach-omap1/leds-h2p2-debug.c @@ -14,6 +14,7 @@  #include <linux/kernel_stat.h>  #include <linux/sched.h>  #include <linux/io.h> +#include <linux/platform_data/gpio-omap.h>  #include <mach/hardware.h>  #include <asm/leds.h> @@ -68,11 +69,13 @@ void h2p2_dbg_leds_event(led_event_t evt)  			gpio_set_value(GPIO_IDLE, 0);  		} -		__raw_writew(~0, &fpga->leds);  		led_state &= ~LED_STATE_ENABLED; -		if (evt == led_halted) { -			iounmap(fpga); -			fpga = NULL; +		if (fpga) { +			__raw_writew(~0, &fpga->leds); +			if (evt == led_halted) { +				iounmap(fpga); +				fpga = NULL; +			}  		}  		goto done; @@ -158,7 +161,7 @@ void h2p2_dbg_leds_event(led_event_t evt)  	/*  	 *  Actually burn the LEDs  	 */ -	if (led_state & LED_STATE_ENABLED) +	if (led_state & LED_STATE_ENABLED && fpga)  		__raw_writew(~hw_led_state, &fpga->leds);  done:  |