public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederik Deweerdt <deweerdt@free.fr>
To: linux-kernel@vger.kernel.org
Cc: arjan@infradead.org, matthew@wil.cx, alan@lxorguk.ukuu.org.uk,
	jeff@garzik.org, akpm@osdl.org, rdunlap@xenotime.net,
	gregkh@suse.de
Subject: [RFC PATCH] move aic7xxx to pci_request_irq
Date: Wed, 4 Oct 2006 19:43:57 +0000	[thread overview]
Message-ID: <20061004194357.GB352@slug> (raw)
In-Reply-To: <20061004193229.GA352@slug>

Hi,

This proof-of-concept patch converts the aic7xxx driver to use the
pci_request_irq() function.

Please note that I'm not submitting the driver changes, they're there
only for illustration purposes. I'll CC the appropriate maintainers
when/if an API is agreed upon.

Regards,
Frederik



diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 86ea7ac..24f70bc 100644
 drivers/scsi/aic7xxx/aic7xxx_osm.h     |    1 -
 drivers/scsi/aic7xxx/aic7xxx_osm_pci.c |   13 -------------
 drivers/scsi/aic7xxx/aic7xxx_pci.c     |   18 ++++++++++++------
 3 files changed, 12 insertions(+), 20 deletions(-)

Index: 2.6.18-mm3/drivers/scsi/aic7xxx/aic7xxx_osm.h
===================================================================
--- 2.6.18-mm3.orig/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ 2.6.18-mm3/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -561,7 +561,6 @@ static inline void	ahc_linux_eisa_exit(v
 int			 ahc_linux_pci_init(void);
 void			 ahc_linux_pci_exit(void);
 int			 ahc_pci_map_registers(struct ahc_softc *ahc);
-int			 ahc_pci_map_int(struct ahc_softc *ahc);
 
 static __inline uint32_t ahc_pci_read_config(ahc_dev_softc_t pci,
 					     int reg, int width);
Index: 2.6.18-mm3/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
===================================================================
--- 2.6.18-mm3.orig/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
+++ 2.6.18-mm3/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
@@ -368,16 +368,3 @@ ahc_pci_map_registers(struct ahc_softc *
 	return (error);
 }
 
-int
-ahc_pci_map_int(struct ahc_softc *ahc)
-{
-	int error;
-
-	error = request_irq(ahc->dev_softc->irq, ahc_linux_isr,
-			    IRQF_SHARED, "aic7xxx", ahc);
-	if (error == 0)
-		ahc->platform_data->irq = ahc->dev_softc->irq;
-	
-	return (-error);
-}
-
Index: 2.6.18-mm3/drivers/scsi/aic7xxx/aic7xxx_pci.c
===================================================================
--- 2.6.18-mm3.orig/drivers/scsi/aic7xxx/aic7xxx_pci.c
+++ 2.6.18-mm3/drivers/scsi/aic7xxx/aic7xxx_pci.c
@@ -968,13 +968,19 @@ ahc_pci_config(struct ahc_softc *ahc, st
 
 	/*
 	 * Allow interrupts now that we are completely setup.
-	 */
-	error = ahc_pci_map_int(ahc);
-	if (error != 0)
-		return (error);
+	 *
+	 * Note: pci_request_irq return value is negated due to aic7xxx
+	 * error handling style
+	 */
+	error = -pci_request_irq(ahc->dev_softc, ahc_linux_isr,
+				 0, "aic7xxx");
+
+	if (!error) {
+		ahc->platform_data->irq = ahc->dev_softc->irq;
+		ahc->init_level++;
+	}
 
-	ahc->init_level++;
-	return (0);
+	return error;
 }
 
 /*

  reply	other threads:[~2006-10-04 19:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-04 19:32 [RFC PATCH] add pci_{request,free}_irq take #3 Frederik Deweerdt
2006-10-04 19:43 ` Frederik Deweerdt [this message]
2006-10-04 19:44 ` [RFC PATCH] move aic79xx to pci_request_irq Frederik Deweerdt
2006-10-04 19:46 ` [RFC PATCH] move tg3 " Frederik Deweerdt
2006-10-04 19:46 ` [RFC PATCH] move e1000 " Frederik Deweerdt
2006-10-04 19:50 ` [RFC PATCH] add pci_{request,free}_irq take #3 Jeff Garzik
2006-10-04 20:29   ` Frederik Deweerdt
2006-10-04 20:33     ` Matthew Wilcox
2006-10-04 21:26       ` Frederik Deweerdt
2006-10-05 13:59         ` Alexey Dobriyan
2006-10-05 14:36           ` Frederik Deweerdt
2006-10-06 10:04             ` Alexey Dobriyan
2006-10-06 10:31               ` Frederik Deweerdt
  -- strict thread matches above, loose matches on Subject: below --
2006-10-03 22:07 [RFC PATCH] add pci_{request,free}_irq take #2 Frederik Deweerdt
2006-10-03 22:14 ` [RFC PATCH] move aic7xxx to pci_request_irq Frederik Deweerdt
2006-09-29 17:15 2.6.18-mm2 Alan Cox
2006-09-29 23:50 ` 2.6.18-mm2 Frederik Deweerdt
2006-09-29 23:43   ` 2.6.18-mm2 Alan Cox
2006-09-30 14:09     ` [-mm patch] aic7xxx: check irq validity (was Re: 2.6.18-mm2) Frederik Deweerdt
2006-09-30 23:58       ` Jeff Garzik
2006-10-01 14:28         ` Matthew Wilcox
2006-10-01 19:05           ` Arjan van de Ven
2006-10-01 19:36             ` Matthew Wilcox
2006-10-02  2:12               ` Arjan van de Ven
2006-10-02 20:00                 ` [RFC PATCH] pci_request_irq (was [-mm patch] aic7xxx: check irq validity) Frederik Deweerdt
2006-10-02 20:07                   ` [RFC PATCH] move aic7xxx to pci_request_irq Frederik Deweerdt
2006-10-02 18:27                     ` Matthew Wilcox
2006-10-02 21:02                       ` Frederik Deweerdt
2006-10-03  3:45                     ` Arjan van de Ven

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=20061004194357.GB352@slug \
    --to=deweerdt@free.fr \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=gregkh@suse.de \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=rdunlap@xenotime.net \
    /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