Fix buttom half irq handling if acc is already disabled
authorNils Faerber <nils.faerber@kernelconcepts.de>
Sun, 5 May 2013 22:07:15 +0000 (00:07 +0200)
committerNils Faerber <nils.faerber@kernelconcepts.de>
Sun, 5 May 2013 22:07:15 +0000 (00:07 +0200)
metawatch/mw_acc.c

index 9c4b0f5..8fdd2a6 100644 (file)
@@ -379,6 +379,9 @@ void mw_acc_handle_irq(void)
        char tstr[16];
 #endif
 
+       if (AccelState != ACCEL_STATE_ENABLED)
+               return;
+
        mw_acc_i2c_read(KIONIX_INT_SRC_REG1, &srcreg1, 1);
 #if defined MW_DEVBOARD_V2
        snprintf(tstr, 16, "accsrc1: 0x%02x\n", srcreg1);