keyboard leds not restored after s2ram in 2.6.32-rc6-00166-g799dd75
diff mbox

Message ID 20091111095218.GA3654@core.coreip.homeip.net
State Accepted
Commit 3cc96351799d3d82c3809aa6970ef537bc1af553
Headers show

Commit Message

Dmitry Torokhov Nov. 11, 2009, 9:52 a.m. UTC
None

Patch
diff mbox

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 61069b2..77b6efe 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1298,17 +1298,24 @@  static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
 	return 0;
 }
 
-#define INPUT_DO_TOGGLE(dev, type, bits, on)			\
-	do {							\
-		int i;						\
-		if (!test_bit(EV_##type, dev->evbit))		\
-			break;					\
-		for (i = 0; i < type##_MAX; i++) {		\
-			if (!test_bit(i, dev->bits##bit) ||	\
-			    !test_bit(i, dev->bits))		\
-				continue;			\
-			dev->event(dev, EV_##type, i, on);	\
-		}						\
+#define INPUT_DO_TOGGLE(dev, type, bits, on)				\
+	do {								\
+		int i;							\
+		bool active;						\
+									\
+		if (!test_bit(EV_##type, dev->evbit))			\
+			break;						\
+									\
+		for (i = 0; i < type##_MAX; i++) {			\
+			if (!test_bit(i, dev->bits##bit))		\
+				continue;				\
+									\
+			active = test_bit(i, dev->bits);		\
+			if (!active && !on)				\
+				continue;				\
+									\
+			dev->event(dev, EV_##type, i, on ? active : 0);	\
+		}							\
 	} while (0)
 
 #ifdef CONFIG_PM