Commit 4ae711f4 authored by Chen Gang's avatar Chen Gang Committed by Jonathan Corbet

Docs: blackfin: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5

Not all blackfin machines support IRQ_TIMER5, but all machines support
IRQ_TIMER2. So add a switch macro for them. The related error:

  Documentation/blackfin/gptimers-example.c: In function 'gptimer_example_init':
  Documentation/blackfin/gptimers-example.c:60:20: error: 'IRQ_TIMER5' undeclared (first use in this function)
    ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data);
                      ^
  Documentation/blackfin/gptimers-example.c:60:20: note: each undeclared identifier is reported only once for each function it appears in
  Documentation/blackfin/gptimers-example.c: In function 'gptimer_example_exit':
  Documentation/blackfin/gptimers-example.c:78:11: error: 'IRQ_TIMER5' undeclared (first use in this function)
    free_irq(IRQ_TIMER5, &data);
             ^

Also notice about 80 columns limitation.
Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 5ebe6afa
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
#define DRIVER_NAME "gptimer_example" #define DRIVER_NAME "gptimer_example"
#ifdef IRQ_TIMER5
#define SAMPLE_IRQ_TIMER IRQ_TIMER5
#else
#define SAMPLE_IRQ_TIMER IRQ_TIMER2
#endif
struct gptimer_data { struct gptimer_data {
uint32_t period, width; uint32_t period, width;
}; };
...@@ -57,7 +63,8 @@ static int __init gptimer_example_init(void) ...@@ -57,7 +63,8 @@ static int __init gptimer_example_init(void)
} }
/* grab the IRQ for the timer */ /* grab the IRQ for the timer */
ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data); ret = request_irq(SAMPLE_IRQ_TIMER, gptimer_example_irq,
IRQF_SHARED, DRIVER_NAME, &data);
if (ret) { if (ret) {
printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n"); printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
peripheral_free(P_TMR5); peripheral_free(P_TMR5);
...@@ -65,7 +72,8 @@ static int __init gptimer_example_init(void) ...@@ -65,7 +72,8 @@ static int __init gptimer_example_init(void)
} }
/* setup the timer and enable it */ /* setup the timer and enable it */
set_gptimer_config(TIMER5_id, WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA); set_gptimer_config(TIMER5_id,
WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA);
enable_gptimers(TIMER5bit); enable_gptimers(TIMER5bit);
return 0; return 0;
...@@ -75,7 +83,7 @@ module_init(gptimer_example_init); ...@@ -75,7 +83,7 @@ module_init(gptimer_example_init);
static void __exit gptimer_example_exit(void) static void __exit gptimer_example_exit(void)
{ {
disable_gptimers(TIMER5bit); disable_gptimers(TIMER5bit);
free_irq(IRQ_TIMER5, &data); free_irq(SAMPLE_IRQ_TIMER, &data);
peripheral_free(P_TMR5); peripheral_free(P_TMR5);
} }
module_exit(gptimer_example_exit); module_exit(gptimer_example_exit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment