Skip to content

Commit

Permalink
atmel_pwm: set up only one PWM clock when allocating a clock
Browse files Browse the repository at this point in the history
This patch will only setup one clock, if free, and return this clock to the
caller.  The previous solution would setup both clocks with the same prescaler
and divider and return PWM_CPR_CLKB, thus taking both clocks in the same call
without the caller knowing.

Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hans-Christian Egtvedt authored and Linus Torvalds committed Jul 24, 2008
1 parent 82736f4 commit 5aa0769
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/misc/atmel_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ int pwm_clk_alloc(unsigned prescale, unsigned div)
if ((mr & 0xffff) == 0) {
mr |= val;
ret = PWM_CPR_CLKA;
}
if ((mr & (0xffff << 16)) == 0) {
} else if ((mr & (0xffff << 16)) == 0) {
mr |= val << 16;
ret = PWM_CPR_CLKB;
}
Expand Down

0 comments on commit 5aa0769

Please sign in to comment.