aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>2008-07-24 00:28:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:25 -0400
commit5aa0769d089125e63f8dc23e0283e559e1790493 (patch)
tree5e5ef96ab69abe0a75ec9712297f2e493055e900 /drivers/misc
parent82736f4d1d2b7063b829cc93171a6e5aea8a9c49 (diff)
atmel_pwm: set up only one PWM clock when allocating a clock
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/atmel_pwm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/misc/atmel_pwm.c b/drivers/misc/atmel_pwm.c
index 5b5a14dab3d3..6aa5294dfec4 100644
--- a/drivers/misc/atmel_pwm.c
+++ b/drivers/misc/atmel_pwm.c
@@ -211,8 +211,7 @@ int pwm_clk_alloc(unsigned prescale, unsigned div)
211 if ((mr & 0xffff) == 0) { 211 if ((mr & 0xffff) == 0) {
212 mr |= val; 212 mr |= val;
213 ret = PWM_CPR_CLKA; 213 ret = PWM_CPR_CLKA;
214 } 214 } else if ((mr & (0xffff << 16)) == 0) {
215 if ((mr & (0xffff << 16)) == 0) {
216 mr |= val << 16; 215 mr |= val << 16;
217 ret = PWM_CPR_CLKB; 216 ret = PWM_CPR_CLKB;
218 } 217 }