diff options
author | Chen Gang <xili_gchen_5257@hotmail.com> | 2015-04-05 00:25:44 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2015-05-07 11:35:14 -0400 |
commit | 4ae711f4a37bff6cf501b48d58f9e28b031b02c9 (patch) | |
tree | a9f604073a1aa05b9fcd7198dec357eedeb0089b | |
parent | 5ebe6afaf0057ac3eaeb98defd5456894b446d22 (diff) |
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: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/blackfin/gptimers-example.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/blackfin/gptimers-example.c b/Documentation/blackfin/gptimers-example.c index b1bd6340e748..283eba993d9d 100644 --- a/Documentation/blackfin/gptimers-example.c +++ b/Documentation/blackfin/gptimers-example.c | |||
@@ -17,6 +17,12 @@ | |||
17 | 17 | ||
18 | #define DRIVER_NAME "gptimer_example" | 18 | #define DRIVER_NAME "gptimer_example" |
19 | 19 | ||
20 | #ifdef IRQ_TIMER5 | ||
21 | #define SAMPLE_IRQ_TIMER IRQ_TIMER5 | ||
22 | #else | ||
23 | #define SAMPLE_IRQ_TIMER IRQ_TIMER2 | ||
24 | #endif | ||
25 | |||
20 | struct gptimer_data { | 26 | struct gptimer_data { |
21 | uint32_t period, width; | 27 | uint32_t period, width; |
22 | }; | 28 | }; |
@@ -57,7 +63,8 @@ static int __init gptimer_example_init(void) | |||
57 | } | 63 | } |
58 | 64 | ||
59 | /* grab the IRQ for the timer */ | 65 | /* grab the IRQ for the timer */ |
60 | ret = request_irq(IRQ_TIMER5, gptimer_example_irq, IRQF_SHARED, DRIVER_NAME, &data); | 66 | ret = request_irq(SAMPLE_IRQ_TIMER, gptimer_example_irq, |
67 | IRQF_SHARED, DRIVER_NAME, &data); | ||
61 | if (ret) { | 68 | if (ret) { |
62 | printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n"); | 69 | printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n"); |
63 | peripheral_free(P_TMR5); | 70 | peripheral_free(P_TMR5); |
@@ -65,7 +72,8 @@ static int __init gptimer_example_init(void) | |||
65 | } | 72 | } |
66 | 73 | ||
67 | /* setup the timer and enable it */ | 74 | /* setup the timer and enable it */ |
68 | set_gptimer_config(TIMER5_id, WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA); | 75 | set_gptimer_config(TIMER5_id, |
76 | WDTH_CAP | PULSE_HI | PERIOD_CNT | IRQ_ENA); | ||
69 | enable_gptimers(TIMER5bit); | 77 | enable_gptimers(TIMER5bit); |
70 | 78 | ||
71 | return 0; | 79 | return 0; |
@@ -75,7 +83,7 @@ module_init(gptimer_example_init); | |||
75 | static void __exit gptimer_example_exit(void) | 83 | static void __exit gptimer_example_exit(void) |
76 | { | 84 | { |
77 | disable_gptimers(TIMER5bit); | 85 | disable_gptimers(TIMER5bit); |
78 | free_irq(IRQ_TIMER5, &data); | 86 | free_irq(SAMPLE_IRQ_TIMER, &data); |
79 | peripheral_free(P_TMR5); | 87 | peripheral_free(P_TMR5); |
80 | } | 88 | } |
81 | module_exit(gptimer_example_exit); | 89 | module_exit(gptimer_example_exit); |