提交 4bbd61fb 编写于 作者: C Christian Gmeiner 提交者: Linus Torvalds

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: NChristian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: NAndres Salomon <dilinger@queued.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5a1e6f75
......@@ -174,7 +174,7 @@ struct cs5535_mfgpt_timer *cs5535_mfgpt_alloc_timer(int timer_nr, int domain)
timer_nr = t < max ? (int) t : -1;
} else {
/* check if the requested timer's available */
if (test_bit(timer_nr, mfgpt->avail))
if (!test_bit(timer_nr, mfgpt->avail))
timer_nr = -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册