aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/clocksource/sh_tmu.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
index 63ed92d56c8f..fec9bedb8f45 100644
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -300,12 +300,12 @@ static void sh_tmu_clocksource_resume(struct clocksource *cs)
300} 300}
301 301
302static int sh_tmu_register_clocksource(struct sh_tmu_channel *ch, 302static int sh_tmu_register_clocksource(struct sh_tmu_channel *ch,
303 const char *name, unsigned long rating) 303 const char *name)
304{ 304{
305 struct clocksource *cs = &ch->cs; 305 struct clocksource *cs = &ch->cs;
306 306
307 cs->name = name; 307 cs->name = name;
308 cs->rating = rating; 308 cs->rating = 200;
309 cs->read = sh_tmu_clocksource_read; 309 cs->read = sh_tmu_clocksource_read;
310 cs->enable = sh_tmu_clocksource_enable; 310 cs->enable = sh_tmu_clocksource_enable;
311 cs->disable = sh_tmu_clocksource_disable; 311 cs->disable = sh_tmu_clocksource_disable;
@@ -402,7 +402,7 @@ static void sh_tmu_clock_event_resume(struct clock_event_device *ced)
402} 402}
403 403
404static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch, 404static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
405 const char *name, unsigned long rating) 405 const char *name)
406{ 406{
407 struct clock_event_device *ced = &ch->ced; 407 struct clock_event_device *ced = &ch->ced;
408 int ret; 408 int ret;
@@ -410,7 +410,7 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
410 ced->name = name; 410 ced->name = name;
411 ced->features = CLOCK_EVT_FEAT_PERIODIC; 411 ced->features = CLOCK_EVT_FEAT_PERIODIC;
412 ced->features |= CLOCK_EVT_FEAT_ONESHOT; 412 ced->features |= CLOCK_EVT_FEAT_ONESHOT;
413 ced->rating = rating; 413 ced->rating = 200;
414 ced->cpumask = cpumask_of(0); 414 ced->cpumask = cpumask_of(0);
415 ced->set_next_event = sh_tmu_clock_event_next; 415 ced->set_next_event = sh_tmu_clock_event_next;
416 ced->set_mode = sh_tmu_clock_event_mode; 416 ced->set_mode = sh_tmu_clock_event_mode;
@@ -433,13 +433,12 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
433} 433}
434 434
435static int sh_tmu_register(struct sh_tmu_channel *ch, const char *name, 435static int sh_tmu_register(struct sh_tmu_channel *ch, const char *name,
436 unsigned long clockevent_rating, 436 bool clockevent, bool clocksource)
437 unsigned long clocksource_rating)
438{ 437{
439 if (clockevent_rating) 438 if (clockevent)
440 sh_tmu_register_clockevent(ch, name, clockevent_rating); 439 sh_tmu_register_clockevent(ch, name);
441 else if (clocksource_rating) 440 else if (clocksource)
442 sh_tmu_register_clocksource(ch, name, clocksource_rating); 441 sh_tmu_register_clocksource(ch, name);
443 442
444 return 0; 443 return 0;
445} 444}
@@ -471,8 +470,8 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch,
471 ch->enable_count = 0; 470 ch->enable_count = 0;
472 471
473 return sh_tmu_register(ch, dev_name(&tmu->pdev->dev), 472 return sh_tmu_register(ch, dev_name(&tmu->pdev->dev),
474 cfg->clockevent_rating, 473 cfg->clockevent_rating != 0,
475 cfg->clocksource_rating); 474 cfg->clocksource_rating != 0);
476} 475}
477 476
478static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) 477static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)