All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5
       [not found] <5520B892.4070200@qq.com>
@ 2015-04-05  4:25 ` Chen Gang
  2015-04-11 13:18   ` Jonathan Corbet
  2015-05-07 15:36   ` Jonathan Corbet
  0 siblings, 2 replies; 5+ messages in thread
From: Chen Gang @ 2015-04-05  4:25 UTC (permalink / raw)
  To: richard.weinberger, corbet; +Cc: linux-doc, linux-kernel


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>
---
 Documentation/blackfin/gptimers-example.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/blackfin/gptimers-example.c b/Documentation/blackfin/gptimers-example.c
index b1bd634..283eba9 100644
--- a/Documentation/blackfin/gptimers-example.c
+++ b/Documentation/blackfin/gptimers-example.c
@@ -17,6 +17,12 @@
 
 #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 {
 	uint32_t period, width;
 };
@@ -57,7 +63,8 @@ static int __init gptimer_example_init(void)
 	}
 
 	/* 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) {
 		printk(KERN_NOTICE DRIVER_NAME ": IRQ request failed\n");
 		peripheral_free(P_TMR5);
@@ -65,7 +72,8 @@ static int __init gptimer_example_init(void)
 	}
 
 	/* 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);
 
 	return 0;
@@ -75,7 +83,7 @@ module_init(gptimer_example_init);
 static void __exit gptimer_example_exit(void)
 {
 	disable_gptimers(TIMER5bit);
-	free_irq(IRQ_TIMER5, &data);
+	free_irq(SAMPLE_IRQ_TIMER, &data);
 	peripheral_free(P_TMR5);
 }
 module_exit(gptimer_example_exit);
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5
  2015-04-05  4:25 ` [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5 Chen Gang
@ 2015-04-11 13:18   ` Jonathan Corbet
  2015-04-11 23:00     ` Chen Gang
  2015-05-07 15:36   ` Jonathan Corbet
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Corbet @ 2015-04-11 13:18 UTC (permalink / raw)
  To: Chen Gang; +Cc: richard.weinberger, linux-doc, linux-kernel

On Sun, 5 Apr 2015 12:25:44 +0800
Chen Gang <xili_gchen_5257@hotmail.com> wrote:

> Not all blackfin machines support IRQ_TIMER5, but all machines support
> IRQ_TIMER2.

I don't know enough about Blackfin to judge whether to take this into the
docs tree or not in the absence of a relevant ack.  Perhaps one could be
forthcoming?

It would also be nice to move this program into tools/ at some point.

Thanks,

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5
  2015-04-11 13:18   ` Jonathan Corbet
@ 2015-04-11 23:00     ` Chen Gang
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Gang @ 2015-04-11 23:00 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: richard.weinberger, linux-doc, linux-kernel

On 4/11/15 21:18, Jonathan Corbet wrote:
> On Sun, 5 Apr 2015 12:25:44 +0800
> Chen Gang <xili_gchen_5257@hotmail.com> wrote:
> 
>> Not all blackfin machines support IRQ_TIMER5, but all machines support
>> IRQ_TIMER2.
> 
> I don't know enough about Blackfin to judge whether to take this into the
> docs tree or not in the absence of a relevant ack.  Perhaps one could be
> forthcoming?
> 

Welcome any blackfin related members' ideas.

> It would also be nice to move this program into tools/ at some point.
> 

For me, I still suggest to let it in Documentation.

 - Documentation can accept ".c" files.

 - The code is simple, it is mainly as an sample/template for developers,
   not mainly for real world using (tools is mainly for real world using,
   not mainly as an sample for developers).


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5
  2015-04-05  4:25 ` [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5 Chen Gang
  2015-04-11 13:18   ` Jonathan Corbet
@ 2015-05-07 15:36   ` Jonathan Corbet
  2015-05-07 21:00     ` Chen Gang
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Corbet @ 2015-05-07 15:36 UTC (permalink / raw)
  To: Chen Gang; +Cc: richard.weinberger, linux-doc, linux-kernel

On Sun, 5 Apr 2015 12:25:44 +0800
Chen Gang <xili_gchen_5257@hotmail.com> wrote:

> Not all blackfin machines support IRQ_TIMER5, but all machines support
> IRQ_TIMER2. So add a switch macro for them.

OK, I've (finally) applied this to the docs tree.

Thanks,

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5
  2015-05-07 15:36   ` Jonathan Corbet
@ 2015-05-07 21:00     ` Chen Gang
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Gang @ 2015-05-07 21:00 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: richard.weinberger, linux-doc, linux-kernel

On 5/7/15 23:36, Jonathan Corbet wrote:
> On Sun, 5 Apr 2015 12:25:44 +0800
> Chen Gang <xili_gchen_5257@hotmail.com> wrote:
> 
>> Not all blackfin machines support IRQ_TIMER5, but all machines support
>> IRQ_TIMER2. So add a switch macro for them.
> 
> OK, I've (finally) applied this to the docs tree.
> 

OK, thank you for your work.

And within this month, I shall try to send patches to be sure of all
architectures have full syscalls.

Also sorry for sending kernel patches delayed during these days (also for
blackfin gcc analyzing). The excuses are:

 - I have no quite enough time resources on open source.

 - During these days, I mainly focused on developing tilegx QEMU which I
   already delayed too much to bare.

I shall try to finish them all within this month.


Thanks.
-- 
Chen Gang

Open, share, and attitude like air, water, and life which God blessed

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-07 20:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <5520B892.4070200@qq.com>
2015-04-05  4:25 ` [PATCH] Documentation: blackfin: gptimers-example: Use new switch macro SAMPLE_IRQ_TIMER instead of IRQ_TIMER5 Chen Gang
2015-04-11 13:18   ` Jonathan Corbet
2015-04-11 23:00     ` Chen Gang
2015-05-07 15:36   ` Jonathan Corbet
2015-05-07 21:00     ` Chen Gang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.