All of lore.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 aic79xx to pci_request_irq
Date: Wed, 4 Oct 2006 19:44:55 +0000	[thread overview]
Message-ID: <20061004194455.GC352@slug> (raw)
In-Reply-To: <20061004193229.GA352@slug>

Hi,

This proof-of-concept patch converts the aic79xx 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/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h
index 448c39c..67897d4 100644
 drivers/scsi/aic7xxx/aic79xx_osm.h     |    1 -
 drivers/scsi/aic7xxx/aic79xx_osm_pci.c |   13 -------------
 drivers/scsi/aic7xxx/aic79xx_pci.c     |   12 ++++++++++--
 3 files changed, 10 insertions(+), 16 deletions(-)

Index: 2.6.18-mm3/drivers/scsi/aic7xxx/aic79xx_osm.h
===================================================================
--- 2.6.18-mm3.orig/drivers/scsi/aic7xxx/aic79xx_osm.h
+++ 2.6.18-mm3/drivers/scsi/aic7xxx/aic79xx_osm.h
@@ -594,7 +594,6 @@ void ahd_power_state_change(struct ahd_s
 int			 ahd_linux_pci_init(void);
 void			 ahd_linux_pci_exit(void);
 int			 ahd_pci_map_registers(struct ahd_softc *ahd);
-int			 ahd_pci_map_int(struct ahd_softc *ahd);
 
 static __inline uint32_t ahd_pci_read_config(ahd_dev_softc_t pci,
 					     int reg, int width);
Index: 2.6.18-mm3/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
===================================================================
--- 2.6.18-mm3.orig/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
+++ 2.6.18-mm3/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
@@ -336,19 +336,6 @@ ahd_pci_map_registers(struct ahd_softc *
 	return (error);
 }
 
-int
-ahd_pci_map_int(struct ahd_softc *ahd)
-{
-	int error;
-
-	error = request_irq(ahd->dev_softc->irq, ahd_linux_isr,
-			    IRQF_SHARED, "aic79xx", ahd);
-	if (!error)
-		ahd->platform_data->irq = ahd->dev_softc->irq;
-	
-	return (-error);
-}
-
 void
 ahd_power_state_change(struct ahd_softc *ahd, ahd_power_state new_state)
 {
Index: 2.6.18-mm3/drivers/scsi/aic7xxx/aic79xx_pci.c
===================================================================
--- 2.6.18-mm3.orig/drivers/scsi/aic7xxx/aic79xx_pci.c
+++ 2.6.18-mm3/drivers/scsi/aic7xxx/aic79xx_pci.c
@@ -376,10 +376,18 @@ ahd_pci_config(struct ahd_softc *ahd, st
 
 	/*
 	 * Allow interrupts now that we are completely setup.
+	 *
+	 * Note: pci_request_irq return value is negated due to aic79xx
+	 * error handling style
 	 */
-	error = ahd_pci_map_int(ahd);
-	if (!error)
+
+	error = -pci_request_irq(ahd->dev_softc, ahd_linux_isr,
+				 0, "aic79xx");
+	if (!error) {
+		ahd->platform_data->irq = ahd->dev_softc->irq;
 		ahd->init_level++;
+	}
+
 	return error;
 }
 

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

Thread overview: 14+ 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 ` [RFC PATCH] move aic7xxx to pci_request_irq Frederik Deweerdt
2006-10-04 19:44 ` Frederik Deweerdt [this message]
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:19 ` [RFC PATCH] move aic79xx to pci_request_irq Frederik Deweerdt

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=20061004194455.GC352@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 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.