@@ -346,7 +346,7 @@ static void __init tcb_setup_single_chan(struct atmel_tc *tc, int mck_divisor_id
346
346
writel (ATMEL_TC_SYNC , tcaddr + ATMEL_TC_BCR );
347
347
}
348
348
349
- static const u8 atmel_tcb_divisors [5 ] = { 2 , 8 , 32 , 128 , 0 , };
349
+ static const u8 atmel_tcb_divisors [] = { 2 , 8 , 32 , 128 };
350
350
351
351
static const struct of_device_id atmel_tcb_of_match [] = {
352
352
{ .compatible = "atmel,at91rm9200-tcb" , .data = (void * )16 , },
@@ -362,7 +362,6 @@ static int __init tcb_clksrc_init(struct device_node *node)
362
362
u64 (* tc_sched_clock )(void );
363
363
u32 rate , divided_rate = 0 ;
364
364
int best_divisor_idx = -1 ;
365
- int clk32k_divisor_idx = -1 ;
366
365
int bits ;
367
366
int i ;
368
367
int ret ;
@@ -416,12 +415,6 @@ static int __init tcb_clksrc_init(struct device_node *node)
416
415
unsigned divisor = atmel_tcb_divisors [i ];
417
416
unsigned tmp ;
418
417
419
- /* remember 32 KiHz clock for later */
420
- if (!divisor ) {
421
- clk32k_divisor_idx = i ;
422
- continue ;
423
- }
424
-
425
418
tmp = rate / divisor ;
426
419
pr_debug ("TC: %u / %-3u [%d] --> %u\n" , rate , divisor , i , tmp );
427
420
if (best_divisor_idx > 0 ) {
@@ -467,7 +460,7 @@ static int __init tcb_clksrc_init(struct device_node *node)
467
460
goto err_disable_t1 ;
468
461
469
462
/* channel 2: periodic and oneshot timer support */
470
- ret = setup_clkevents (& tc , clk32k_divisor_idx );
463
+ ret = setup_clkevents (& tc , ATMEL_TC_TIMER_CLOCK5 );
471
464
if (ret )
472
465
goto err_unregister_clksrc ;
473
466
0 commit comments