Skip to content

Commit

Permalink
drivers/misc/cs5535-mfgpt.c: fix wrong if condition
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Andres Salomon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
austriancoder authored and torvalds committed Jun 16, 2011
1 parent 5a1e6f7 commit 4bbd61f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/cs5535-mfgpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4bbd61f

Please sign in to comment.