diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-03-10 02:26:25 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-03-10 02:26:25 -0500 |
commit | 214a607a4f5bf5a14dab0304ba350cdaf3916795 (patch) | |
tree | b277d47ffff520d368024c4a5c539fafcea88c3e /drivers/clocksource/sh_tmu.c | |
parent | a636ee7fb35b731ba2b331f6294e809bb6be09c8 (diff) |
clocksource: Use dev_name() universally across the SH drivers.
There is no need to copy in the name from the sh timer config now that
dev_name() is available early. We prefer the dev_name() variant for
consistent naming.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/clocksource/sh_tmu.c')
-rw-r--r-- | drivers/clocksource/sh_tmu.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 961f5b5ef6a3..34239453ebaf 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c | |||
@@ -106,13 +106,12 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start) | |||
106 | 106 | ||
107 | static int sh_tmu_enable(struct sh_tmu_priv *p) | 107 | static int sh_tmu_enable(struct sh_tmu_priv *p) |
108 | { | 108 | { |
109 | struct sh_timer_config *cfg = p->pdev->dev.platform_data; | ||
110 | int ret; | 109 | int ret; |
111 | 110 | ||
112 | /* enable clock */ | 111 | /* enable clock */ |
113 | ret = clk_enable(p->clk); | 112 | ret = clk_enable(p->clk); |
114 | if (ret) { | 113 | if (ret) { |
115 | pr_err("sh_tmu: cannot enable clock \"%s\"\n", cfg->clk); | 114 | dev_err(&p->pdev->dev, "cannot enable clock\n"); |
116 | return ret; | 115 | return ret; |
117 | } | 116 | } |
118 | 117 | ||
@@ -228,7 +227,7 @@ static int sh_tmu_register_clocksource(struct sh_tmu_priv *p, | |||
228 | cs->disable = sh_tmu_clocksource_disable; | 227 | cs->disable = sh_tmu_clocksource_disable; |
229 | cs->mask = CLOCKSOURCE_MASK(32); | 228 | cs->mask = CLOCKSOURCE_MASK(32); |
230 | cs->flags = CLOCK_SOURCE_IS_CONTINUOUS; | 229 | cs->flags = CLOCK_SOURCE_IS_CONTINUOUS; |
231 | pr_info("sh_tmu: %s used as clock source\n", cs->name); | 230 | dev_info(&p->pdev->dev, "used as clock source\n"); |
232 | clocksource_register(cs); | 231 | clocksource_register(cs); |
233 | return 0; | 232 | return 0; |
234 | } | 233 | } |
@@ -276,13 +275,11 @@ static void sh_tmu_clock_event_mode(enum clock_event_mode mode, | |||
276 | 275 | ||
277 | switch (mode) { | 276 | switch (mode) { |
278 | case CLOCK_EVT_MODE_PERIODIC: | 277 | case CLOCK_EVT_MODE_PERIODIC: |
279 | pr_info("sh_tmu: %s used for periodic clock events\n", | 278 | dev_info(&p->pdev->dev, "used for periodic clock events\n"); |
280 | ced->name); | ||
281 | sh_tmu_clock_event_start(p, 1); | 279 | sh_tmu_clock_event_start(p, 1); |
282 | break; | 280 | break; |
283 | case CLOCK_EVT_MODE_ONESHOT: | 281 | case CLOCK_EVT_MODE_ONESHOT: |
284 | pr_info("sh_tmu: %s used for oneshot clock events\n", | 282 | dev_info(&p->pdev->dev, "used for oneshot clock events\n"); |
285 | ced->name); | ||
286 | sh_tmu_clock_event_start(p, 0); | 283 | sh_tmu_clock_event_start(p, 0); |
287 | break; | 284 | break; |
288 | case CLOCK_EVT_MODE_UNUSED: | 285 | case CLOCK_EVT_MODE_UNUSED: |
@@ -323,13 +320,13 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p, | |||
323 | ced->set_next_event = sh_tmu_clock_event_next; | 320 | ced->set_next_event = sh_tmu_clock_event_next; |
324 | ced->set_mode = sh_tmu_clock_event_mode; | 321 | ced->set_mode = sh_tmu_clock_event_mode; |
325 | 322 | ||
326 | pr_info("sh_tmu: %s used for clock events\n", ced->name); | 323 | dev_info(&p->pdev->dev, "used for clock events\n"); |
327 | clockevents_register_device(ced); | 324 | clockevents_register_device(ced); |
328 | 325 | ||
329 | ret = setup_irq(p->irqaction.irq, &p->irqaction); | 326 | ret = setup_irq(p->irqaction.irq, &p->irqaction); |
330 | if (ret) { | 327 | if (ret) { |
331 | pr_err("sh_tmu: failed to request irq %d\n", | 328 | dev_err(&p->pdev->dev, "failed to request irq %d\n", |
332 | p->irqaction.irq); | 329 | p->irqaction.irq); |
333 | return; | 330 | return; |
334 | } | 331 | } |
335 | } | 332 | } |
@@ -378,12 +375,12 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
378 | /* map memory, let mapbase point to our channel */ | 375 | /* map memory, let mapbase point to our channel */ |
379 | p->mapbase = ioremap_nocache(res->start, resource_size(res)); | 376 | p->mapbase = ioremap_nocache(res->start, resource_size(res)); |
380 | if (p->mapbase == NULL) { | 377 | if (p->mapbase == NULL) { |
381 | pr_err("sh_tmu: failed to remap I/O memory\n"); | 378 | dev_err(&p->pdev->dev, "failed to remap I/O memory\n"); |
382 | goto err0; | 379 | goto err0; |
383 | } | 380 | } |
384 | 381 | ||
385 | /* setup data for setup_irq() (too early for request_irq()) */ | 382 | /* setup data for setup_irq() (too early for request_irq()) */ |
386 | p->irqaction.name = cfg->name; | 383 | p->irqaction.name = dev_name(&p->pdev->dev); |
387 | p->irqaction.handler = sh_tmu_interrupt; | 384 | p->irqaction.handler = sh_tmu_interrupt; |
388 | p->irqaction.dev_id = p; | 385 | p->irqaction.dev_id = p; |
389 | p->irqaction.irq = irq; | 386 | p->irqaction.irq = irq; |
@@ -392,12 +389,12 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
392 | /* get hold of clock */ | 389 | /* get hold of clock */ |
393 | p->clk = clk_get(&p->pdev->dev, cfg->clk); | 390 | p->clk = clk_get(&p->pdev->dev, cfg->clk); |
394 | if (IS_ERR(p->clk)) { | 391 | if (IS_ERR(p->clk)) { |
395 | pr_err("sh_tmu: cannot get clock \"%s\"\n", cfg->clk); | 392 | dev_err(&p->pdev->dev, "cannot get clock\n"); |
396 | ret = PTR_ERR(p->clk); | 393 | ret = PTR_ERR(p->clk); |
397 | goto err1; | 394 | goto err1; |
398 | } | 395 | } |
399 | 396 | ||
400 | return sh_tmu_register(p, cfg->name, | 397 | return sh_tmu_register(p, (char *)dev_name(&p->pdev->dev), |
401 | cfg->clockevent_rating, | 398 | cfg->clockevent_rating, |
402 | cfg->clocksource_rating); | 399 | cfg->clocksource_rating); |
403 | err1: | 400 | err1: |
@@ -409,11 +406,10 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
409 | static int __devinit sh_tmu_probe(struct platform_device *pdev) | 406 | static int __devinit sh_tmu_probe(struct platform_device *pdev) |
410 | { | 407 | { |
411 | struct sh_tmu_priv *p = platform_get_drvdata(pdev); | 408 | struct sh_tmu_priv *p = platform_get_drvdata(pdev); |
412 | struct sh_timer_config *cfg = pdev->dev.platform_data; | ||
413 | int ret; | 409 | int ret; |
414 | 410 | ||
415 | if (p) { | 411 | if (p) { |
416 | pr_info("sh_tmu: %s kept as earlytimer\n", cfg->name); | 412 | dev_info(&pdev->dev, "kept as earlytimer\n"); |
417 | return 0; | 413 | return 0; |
418 | } | 414 | } |
419 | 415 | ||