summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap1/leds-h2p2-debug.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-09-13 07:42:36 +0400
committerTony Lindgren <tony@atomide.com>2012-09-13 07:42:36 +0400
commit3c101c41fbe5daf88afbbd575542aa1d047812bb (patch)
tree97b8837a7ef888f07d01ff7109303402dd8fed2e /arch/arm/mach-omap1/leds-h2p2-debug.c
parentf191f40c1819ffdca05408e6349f7fd30ef1cc36 (diff)
parent7852ec0536ca39cefffc6301dc77f8ae55592926 (diff)
downloadlinux-3c101c41fbe5daf88afbbd575542aa1d047812bb.tar.xz
Merge tag 'omap-cleanup-b-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into cleanup-makefile-sparse
smatch and string-wrapping cleanups for the OMAP subarch code. These changes fix some of the more meaningful warnings that smatch returns for the OMAP subarch code, and unwraps strings that are wrapped at the 80-column boundary, to conform with the current practice. Basic build, boot, and PM logs are available here: http://www.pwsan.com/omap/testlogs/warnings_a_cleanup_3.7/20120912025927/
Diffstat (limited to 'arch/arm/mach-omap1/leds-h2p2-debug.c')
-rw-r--r--arch/arm/mach-omap1/leds-h2p2-debug.c12
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 7f4bba9fa02e..6f958aec9459 100644
--- a/arch/arm/mach-omap1/leds-h2p2-debug.c
+++ b/arch/arm/mach-omap1/leds-h2p2-debug.c
@@ -69,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;
@@ -159,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: