linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds-ot200: Fix misbehavior caused by wrong bit masks
@ 2013-02-13 15:58 Christian Gmeiner
  2013-02-13 15:54 ` Greg KH
  2013-02-15 22:47 ` Bryan Wu
  0 siblings, 2 replies; 13+ messages in thread
From: Christian Gmeiner @ 2013-02-13 15:58 UTC (permalink / raw)
  To: cooloney, linux-next, linux-kernel, stable, akpm; +Cc: Christian Gmeiner

During the development of this driver an in-house register
documentation was used. The last weeks some integration tests
were done and this problem was found. It turned out that
the released register documentation is wrong.

The fix is very simple: shift all masks by one.

Our customers can control LEDs from userspace via Java,
C++ or what every. They have running/working applications where
they want to control led_3 but led_2 get's used.
I got a bug report in our in-house bug tracker so it would be
great to fix this upstream.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 drivers/leds/leds-ot200.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/leds/leds-ot200.c b/drivers/leds/leds-ot200.c
index ee14662..98cae52 100644
--- a/drivers/leds/leds-ot200.c
+++ b/drivers/leds/leds-ot200.c
@@ -47,37 +47,37 @@ static struct ot200_led leds[] = {
 	{
 		.name = "led_1",
 		.port = 0x49,
-		.mask = BIT(7),
+		.mask = BIT(6),
 	},
 	{
 		.name = "led_2",
 		.port = 0x49,
-		.mask = BIT(6),
+		.mask = BIT(5),
 	},
 	{
 		.name = "led_3",
 		.port = 0x49,
-		.mask = BIT(5),
+		.mask = BIT(4),
 	},
 	{
 		.name = "led_4",
 		.port = 0x49,
-		.mask = BIT(4),
+		.mask = BIT(3),
 	},
 	{
 		.name = "led_5",
 		.port = 0x49,
-		.mask = BIT(3),
+		.mask = BIT(2),
 	},
 	{
 		.name = "led_6",
 		.port = 0x49,
-		.mask = BIT(2),
+		.mask = BIT(1),
 	},
 	{
 		.name = "led_7",
 		.port = 0x49,
-		.mask = BIT(1),
+		.mask = BIT(0),
 	}
 };
 
-- 
1.7.12.2.421.g261b511


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-05-15  6:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-13 15:58 [PATCH] leds-ot200: Fix misbehavior caused by wrong bit masks Christian Gmeiner
2013-02-13 15:54 ` Greg KH
2013-02-15 22:47 ` Bryan Wu
2013-02-23  9:20   ` Christian Gmeiner
2013-03-04  7:40     ` Christian Gmeiner
2013-03-05 18:46       ` Bryan Wu
2013-03-08  7:26         ` Christian Gmeiner
2013-05-12 10:11           ` Christian Gmeiner
2013-05-14  7:06             ` Christian Gmeiner
2013-05-14 17:12               ` Bryan Wu
2013-05-14 17:16                 ` Andrew Morton
2013-05-14 17:36                   ` Bryan Wu
2013-05-15  6:38                     ` Christian Gmeiner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).