diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-02-17 05:27:49 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-04-16 06:03:17 -0400 |
commit | 1c56cf6b048e1e1bbe08faf38b5592b373905ac5 (patch) | |
tree | 4cbf92e8d566fa1be0c255f558338928a2d30f9e | |
parent | bfa76bb12f23ecf0c6d07c302f4571a6fe9bc3e3 (diff) |
clocksource: sh_tmu: Use request_irq() instead of setup_irq()
The driver claims it needs to register an interrupt handler too early
for request_irq(). This might have been true in the past, but the only
meaningful difference between request_irq() and setup_irq() today is an
additional kzalloc() call in request_irq(). As the driver calls
kmalloc() itself we know that the slab allocator is available, we can
thus switch to request_irq().
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-rw-r--r-- | drivers/clocksource/sh_tmu.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index ecd7b60bfdfa..8613cc90bb74 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c | |||
@@ -38,7 +38,7 @@ | |||
38 | struct sh_tmu_priv { | 38 | struct sh_tmu_priv { |
39 | void __iomem *mapbase; | 39 | void __iomem *mapbase; |
40 | struct clk *clk; | 40 | struct clk *clk; |
41 | struct irqaction irqaction; | 41 | int irq; |
42 | struct platform_device *pdev; | 42 | struct platform_device *pdev; |
43 | unsigned long rate; | 43 | unsigned long rate; |
44 | unsigned long periodic; | 44 | unsigned long periodic; |
@@ -401,10 +401,11 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p, | |||
401 | 401 | ||
402 | clockevents_config_and_register(ced, 1, 0x300, 0xffffffff); | 402 | clockevents_config_and_register(ced, 1, 0x300, 0xffffffff); |
403 | 403 | ||
404 | ret = setup_irq(p->irqaction.irq, &p->irqaction); | 404 | ret = request_irq(p->irq, sh_tmu_interrupt, |
405 | IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING, | ||
406 | dev_name(&p->pdev->dev), p); | ||
405 | if (ret) { | 407 | if (ret) { |
406 | dev_err(&p->pdev->dev, "failed to request irq %d\n", | 408 | dev_err(&p->pdev->dev, "failed to request irq %d\n", p->irq); |
407 | p->irqaction.irq); | ||
408 | return; | 409 | return; |
409 | } | 410 | } |
410 | } | 411 | } |
@@ -425,7 +426,7 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
425 | { | 426 | { |
426 | struct sh_timer_config *cfg = pdev->dev.platform_data; | 427 | struct sh_timer_config *cfg = pdev->dev.platform_data; |
427 | struct resource *res; | 428 | struct resource *res; |
428 | int irq, ret; | 429 | int ret; |
429 | ret = -ENXIO; | 430 | ret = -ENXIO; |
430 | 431 | ||
431 | memset(p, 0, sizeof(*p)); | 432 | memset(p, 0, sizeof(*p)); |
@@ -444,8 +445,8 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
444 | goto err0; | 445 | goto err0; |
445 | } | 446 | } |
446 | 447 | ||
447 | irq = platform_get_irq(p->pdev, 0); | 448 | p->irq = platform_get_irq(p->pdev, 0); |
448 | if (irq < 0) { | 449 | if (p->irq < 0) { |
449 | dev_err(&p->pdev->dev, "failed to get irq\n"); | 450 | dev_err(&p->pdev->dev, "failed to get irq\n"); |
450 | goto err0; | 451 | goto err0; |
451 | } | 452 | } |
@@ -457,13 +458,6 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) | |||
457 | goto err0; | 458 | goto err0; |
458 | } | 459 | } |
459 | 460 | ||
460 | /* setup data for setup_irq() (too early for request_irq()) */ | ||
461 | p->irqaction.name = dev_name(&p->pdev->dev); | ||
462 | p->irqaction.handler = sh_tmu_interrupt; | ||
463 | p->irqaction.dev_id = p; | ||
464 | p->irqaction.irq = irq; | ||
465 | p->irqaction.flags = IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING; | ||
466 | |||
467 | /* get hold of clock */ | 461 | /* get hold of clock */ |
468 | p->clk = clk_get(&p->pdev->dev, "tmu_fck"); | 462 | p->clk = clk_get(&p->pdev->dev, "tmu_fck"); |
469 | if (IS_ERR(p->clk)) { | 463 | if (IS_ERR(p->clk)) { |