aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2011-06-15 18:08:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-15 23:04:00 -0400
commit4bbd61fb9726808e72ab2aa440401f6e5e1aa8f7 (patch)
tree334f2327d82f065b20d71a66c4133399cce263b1 /drivers/misc
parent5a1e6f75831bf1f8e596d642cd8a2512f11548fc (diff)
drivers/misc/cs5535-mfgpt.c: fix wrong if condition
Fix the wrong `if' condition for the check if the requested timer is available. The bitmap avail is used to store if a timer is used already. test_bit() is used to check if the requested timer is available. If a bit in the avail bitmap is set it means that the timer is available. The runtime effect would be that allocating a specific timer always fails (versus telling cs5535_mfgpt_alloc_timer to allocate the first available timer, which works). Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/cs5535-mfgpt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c
index e01e08c8c88b..bc685bfc4c33 100644
--- a/drivers/misc/cs5535-mfgpt.c
+++ b/drivers/misc/cs5535-mfgpt.c
@@ -174,7 +174,7 @@ struct cs5535_mfgpt_timer *cs5535_mfgpt_alloc_timer(int timer_nr, int domain)
174 timer_nr = t < max ? (int) t : -1; 174 timer_nr = t < max ? (int) t : -1;
175 } else { 175 } else {
176 /* check if the requested timer's available */ 176 /* check if the requested timer's available */
177 if (test_bit(timer_nr, mfgpt->avail)) 177 if (!test_bit(timer_nr, mfgpt->avail))
178 timer_nr = -1; 178 timer_nr = -1;
179 } 179 }
180 180