Linux M68K Architecture development
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 07/28] m68k/irq: Switch irq_chip methods to "struct irq_data *data"
Date: Sun, 11 Sep 2011 23:40:50 +1000 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1109112327500.2286@nippy.intranet> (raw)
In-Reply-To: <1315742394-16036-8-git-send-email-geert@linux-m68k.org>


On Sun, 11 Sep 2011, Geert Uytterhoeven wrote:

> diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
> index ffa1b3f..3cee6d2 100644
> --- a/arch/m68k/mac/macints.c
> +++ b/arch/m68k/mac/macints.c
> @@ -193,10 +193,20 @@ irqreturn_t mac_debug_handler(int, void *);
>  void mac_enable_irq(unsigned int irq);
>  void mac_disable_irq(unsigned int irq);
>  
> +static void mac_irq_enable(struct irq_data *data)
> +{
> +	mac_enable_irq(data->irq);
> +}
> +
> +static void mac_irq_disable(struct irq_data *data)
> +{
> +	mac_disable_irq(data->irq);
> +}
> +
>  static struct irq_chip mac_irq_chip = {
>  	.name		= "mac",
> -	.irq_enable	= mac_enable_irq,
> -	.irq_disable	= mac_disable_irq,
> +	.irq_enable	= mac_irq_enable,
> +	.irq_disable	= mac_irq_disable,
>  };
>  
>  void __init mac_init_IRQ(void)


I wrote a patch (below) to remove these wrapper functions from the 
m68k-genirq branch. What do you think of it? (Perhaps fold it into the 
patch above?)

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Index: linux-m68k/arch/m68k/mac/baboon.c
===================================================================
--- linux-m68k.orig/arch/m68k/mac/baboon.c	2011-08-27 22:52:44.000000000 +1000
+++ linux-m68k/arch/m68k/mac/baboon.c	2011-08-27 22:53:10.000000000 +1000
@@ -23,9 +23,6 @@
 
 /* #define DEBUG_IRQS */
 
-extern void mac_enable_irq(unsigned int);
-extern void mac_disable_irq(unsigned int);
-
 int baboon_present;
 static volatile struct baboon *baboon;
 static unsigned char baboon_disabled;
@@ -152,7 +149,7 @@ void baboon_irq_enable(int irq)
 
 	baboon_disabled &= ~(1 << irq_idx);
 	if (!baboon_disabled)
-		mac_enable_irq(IRQ_NUBUS_C);
+		mac_irq_enable(irq_get_irq_data(IRQ_NUBUS_C));
 }
 
 void baboon_irq_disable(int irq)
@@ -165,7 +162,7 @@ void baboon_irq_disable(int irq)
 
 	baboon_disabled |= 1 << irq_idx;
 	if (baboon_disabled)
-		mac_disable_irq(IRQ_NUBUS_C);
+		mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
 }
 
 void baboon_irq_clear(int irq)
Index: linux-m68k/arch/m68k/mac/macints.c
===================================================================
--- linux-m68k.orig/arch/m68k/mac/macints.c	2011-08-27 22:52:44.000000000 +1000
+++ linux-m68k/arch/m68k/mac/macints.c	2011-08-27 22:52:58.000000000 +1000
@@ -190,19 +190,6 @@ irqreturn_t mac_debug_handler(int, void
 
 /* #define DEBUG_MACINTS */
 
-void mac_enable_irq(unsigned int irq);
-void mac_disable_irq(unsigned int irq);
-
-static void mac_irq_enable(struct irq_data *data)
-{
-	mac_enable_irq(data->irq);
-}
-
-static void mac_irq_disable(struct irq_data *data)
-{
-	mac_disable_irq(data->irq);
-}
-
 static struct irq_chip mac_irq_chip = {
 	.name		= "mac",
 	.irq_enable	= mac_irq_enable,
@@ -250,16 +237,17 @@ void __init mac_init_IRQ(void)
 }
 
 /*
- *  mac_enable_irq - enable an interrupt source
- * mac_disable_irq - disable an interrupt source
+ *  mac_irq_enable - enable an interrupt source
+ * mac_irq_disable - disable an interrupt source
  *   mac_clear_irq - clears a pending interrupt
- * mac_pending_irq - Returns the pending status of an IRQ (nonzero = pending)
+ * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending)
  *
  * These routines are just dispatchers to the VIA/OSS/PSC routines.
  */
 
-void mac_enable_irq(unsigned int irq)
+void mac_irq_enable(struct irq_data *data)
 {
+	int irq = data->irq;
 	int irq_src = IRQ_SRC(irq);
 
 	switch(irq_src) {
@@ -292,8 +280,9 @@ void mac_enable_irq(unsigned int irq)
 	}
 }
 
-void mac_disable_irq(unsigned int irq)
+void mac_irq_disable(struct irq_data *data)
 {
+	int irq = data->irq;
 	int irq_src = IRQ_SRC(irq);
 
 	switch(irq_src) {
Index: linux-m68k/arch/m68k/include/asm/macintosh.h
===================================================================
--- linux-m68k.orig/arch/m68k/include/asm/macintosh.h	2011-08-27 22:52:44.000000000 +1000
+++ linux-m68k/arch/m68k/include/asm/macintosh.h	2011-08-27 22:52:58.000000000 +1000
@@ -12,6 +12,8 @@ extern void mac_reset(void);
 extern void mac_poweroff(void);
 extern void mac_init_IRQ(void);
 extern int mac_irq_pending(unsigned int);
+extern void mac_irq_enable(struct irq_data *data);
+extern void mac_irq_disable(struct irq_data *data);
 
 /*
  *	Floppy driver magic hook - probably shouldn't be here

  parent reply	other threads:[~2011-09-11 13:40 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 11:59 [PATCH 00/28 v6] m68k: Convert to genirq Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 01/28] genirq: Add missing "else" in irq_shutdown() Geert Uytterhoeven
2011-09-12  7:53   ` Thomas Gleixner
2011-09-11 11:59 ` [PATCH 02/28] ide-{cd,floppy,tape}: Do not include <linux/irq.> Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 03/28] keyboard: " Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 04/28] m68k/irq: Rename irq_controller to irq_chip Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 05/28] m68k/irq: Kill irq_node_t typedef, always use struct irq_node Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 06/28] m68k/irq: Rename irq_node to irq_data Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 07/28] m68k/irq: Switch irq_chip methods to "struct irq_data *data" Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 08/28] m68k/irq: Rename setup_irq() to m68k_setup_irq() and make it static Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 09/28] m68k/irq: Extract irq_set_chip() Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 10/28] m68k/irq: Add m68k_setup_irq_controller() Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 11/28] m68k/irq: Rename {,__}m68k_handle_int() Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 12/28] m68k/irq: Remove obsolete IRQ_FLG_* definitions and users Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 13/28] m68k/irq: Add genirq support Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 14/28] m68k/atari: Convert Atari to genirq Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 15/28] m68k/atari: Remove code and comments about different irq types Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 16/28] m68k/amiga: Refactor amiints.c Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 17/28] m68k/amiga: Convert Amiga to genirq Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 18/28] m68k/amiga: Optimize interrupts using chain handlers Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 19/28] m68k/mac: Convert Mac to genirq Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 20/28] m68k/mac: Optimize interrupts using chain handlers Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 21/28] m68k/hp300: Convert HP9000/300 and HP9000/400 to genirq Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 22/28] m68k/vme: Convert VME " Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 23/28] m68k/apollo: Convert Apollo " Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 24/28] m68k/sun3: Use the kstat_irqs_cpu() wrapper Geert Uytterhoeven
2011-09-12 17:38   ` Sam Creasey
2011-09-11 11:59 ` [PATCH 25/28] m68k/sun3: Convert Sun3/3x to genirq Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 26/28] m68k/q40: Convert Q40/Q60 " Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 27/28] m68k/irq: Remove obsolete m68k irq framework Geert Uytterhoeven
2011-09-11 11:59 ` [PATCH 28/28] m68k/irq: Remove obsolete support for user vector interrupt fixups Geert Uytterhoeven
     [not found] ` <1315742394-16036-8-git-send-email-geert@linux-m68k.org>
2011-09-11 13:40   ` Finn Thain [this message]
2011-09-11 17:46     ` [PATCH 07/28] m68k/irq: Switch irq_chip methods to "struct irq_data *data" Geert Uytterhoeven
     [not found]     ` <CAMuHMdWri-LyhDN+z-WpJUkERekAwkD_F88VOtB9kEm_u=QzrA@mail.gmail.com>
2011-09-12  2:48       ` Finn Thain
     [not found] ` <1315742394-16036-3-git-send-email-geert@linux-m68k.org>
2011-09-12  9:59   ` [PATCH 02/28] ide-{cd,floppy,tape}: Do not include <linux/irq.> Sergei Shtylyov
2011-09-13 11:11 ` [PATCH 00/28 v6] m68k: Convert to genirq Finn Thain
2011-09-13 11:18   ` Geert Uytterhoeven
     [not found]   ` <CAMuHMdXJEeooAjdQo+JhUWJcrGzKZb-jQPPhVggy3ocQyPe3Lw@mail.gmail.com>
2011-09-13 17:26     ` Finn Thain
2011-10-20 12:18 ` Geert Uytterhoeven
     [not found] ` <CAMuHMdWOhKcoDoyTnKJzruZ=gpV5uKNFpXnGCkrac7oEkCihJw@mail.gmail.com>
2011-10-20 13:40   ` Finn Thain
2011-10-20 15:02     ` Geert Uytterhoeven
     [not found]     ` <CAMuHMdVMp65XzV2zu7V8sgwsniCAxD7NDDnHSvp5gO-8g1ovHg@mail.gmail.com>
2011-10-20 16:03       ` Geert Uytterhoeven
2011-10-20 23:30         ` Finn Thain
2011-10-23  9:49   ` Geert Uytterhoeven
     [not found]   ` <CAMuHMdX7C5NU5_MO5GdO=Pf2X59B3vFo4Y9B5wg-NQzwVbbLZA@mail.gmail.com>
2011-10-23 11:29     ` Greg Ungerer
2011-10-23 12:12       ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1109112327500.2286@nippy.intranet \
    --to=fthain@telegraphics.com.au \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox