public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Maxey <dwm@enoyolf.org>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: Ravi Anand <ravi.anand@qlogic.com>,
	David Somayajulu <david.somayajulu@qlogic.com>,
	open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org
Subject: [PATCH 3/3] qla4xxx: iospace_config move defn
Date: Wed, 09 Aug 2006 13:42:44 -0500	[thread overview]
Message-ID: <20060809184243.2021.48891.stgit@bebe.enoyolf.org> (raw)
In-Reply-To: <20060809182406.2021.90492.stgit@bebe.enoyolf.org>

From: Doug Maxey <dwm@enoyolf.org>

Move the defn before the caller, and remove the decl.

Signed-off-by: Doug Maxey <dwm@enoyolf.org>
---

 drivers/scsi/qla4xxx/ql4_os.c |  126 ++++++++++++++++++++---------------------
 1 files changed, 62 insertions(+), 64 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index f656fb3..30f245a 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -46,8 +46,6 @@ MODULE_PARM_DESC(extended_error_logging,
 
 void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha);
 
-static int qla4xxx_iospace_config(struct scsi_qla_host *ha);
-
 /*
  * iSCSI template entry points
  */
@@ -1138,6 +1136,68 @@ static void qla4xxx_free_adapter(struct 
 
 }
 
+/***
+ * qla4xxx_iospace_config - maps registers
+ * @ha: pointer to adapter structure
+ *
+ * This routines maps HBA's registers from the pci address space
+ * into the kernel virtual address space for memory mapped i/o.
+ **/
+static int qla4xxx_iospace_config(struct scsi_qla_host *ha)
+{
+	unsigned long pio, pio_len, pio_flags;
+	unsigned long mmio, mmio_len, mmio_flags;
+
+	pio = pci_resource_start(ha->pdev, 0);
+	pio_len = pci_resource_len(ha->pdev, 0);
+	pio_flags = pci_resource_flags(ha->pdev, 0);
+	if (pio_flags & IORESOURCE_IO) {
+		if (pio_len < MIN_IOBASE_LEN) {
+			dev_warn(&ha->pdev->dev,
+				   "Invalid PCI I/O region size\n");
+			pio = 0;
+		}
+	} else {
+		dev_warn(&ha->pdev->dev, "region #0 not a PIO resource\n");
+		pio = 0;
+	}
+
+	/* Use MMIO operations for all accesses. */
+	mmio = pci_resource_start(ha->pdev, 1);
+	mmio_len = pci_resource_len(ha->pdev, 1);
+	mmio_flags = pci_resource_flags(ha->pdev, 1);
+
+	if (!(mmio_flags & IORESOURCE_MEM)) {
+		dev_err(&ha->pdev->dev,
+			   "region #0 not an MMIO resource, aborting\n");
+		goto iospace_error_exit;
+	}
+	if (mmio_len < MIN_IOBASE_LEN) {
+		dev_err(&ha->pdev->dev,
+			   "Invalid PCI mem region size, aborting\n");
+		goto iospace_error_exit;
+	}
+
+	if (pci_request_regions(ha->pdev, DRIVER_NAME)) {
+		dev_warn(&ha->pdev->dev,
+			 "Failed to reserve PIO/MMIO regions\n");
+		goto iospace_error_exit;
+	}
+
+	ha->pio_address = pio;
+	ha->pio_length = pio_len;
+	ha->reg = ioremap(mmio, MIN_IOBASE_LEN);
+	if (!ha->reg) {
+		dev_err(&ha->pdev->dev, "cannot remap MMIO, aborting\n");
+		goto iospace_error_exit;
+	}
+
+	return 0;
+
+iospace_error_exit:
+	return -ENOMEM;
+}
+
 /**
  * qla4xxx_probe_adapter - callback function to probe HBA
  * @pdev: pointer to pci_dev structure
@@ -1321,68 +1381,6 @@ static void __devexit qla4xxx_remove_ada
 	pci_set_drvdata(pdev, NULL);
 }
 
-/***
- * qla4xxx_iospace_config - maps registers
- * @ha: pointer to adapter structure
- *
- * This routines maps HBA's registers from the pci address space
- * into the kernel virtual address space for memory mapped i/o.
- **/
-static int qla4xxx_iospace_config(struct scsi_qla_host *ha)
-{
-	unsigned long pio, pio_len, pio_flags;
-	unsigned long mmio, mmio_len, mmio_flags;
-
-	pio = pci_resource_start(ha->pdev, 0);
-	pio_len = pci_resource_len(ha->pdev, 0);
-	pio_flags = pci_resource_flags(ha->pdev, 0);
-	if (pio_flags & IORESOURCE_IO) {
-		if (pio_len < MIN_IOBASE_LEN) {
-			dev_warn(&ha->pdev->dev,
-				   "Invalid PCI I/O region size\n");
-			pio = 0;
-		}
-	} else {
-		dev_warn(&ha->pdev->dev, "region #0 not a PIO resource\n");
-		pio = 0;
-	}
-
-	/* Use MMIO operations for all accesses. */
-	mmio = pci_resource_start(ha->pdev, 1);
-	mmio_len = pci_resource_len(ha->pdev, 1);
-	mmio_flags = pci_resource_flags(ha->pdev, 1);
-
-	if (!(mmio_flags & IORESOURCE_MEM)) {
-		dev_err(&ha->pdev->dev,
-			   "region #0 not an MMIO resource, aborting\n");
-		goto iospace_error_exit;
-	}
-	if (mmio_len < MIN_IOBASE_LEN) {
-		dev_err(&ha->pdev->dev,
-			   "Invalid PCI mem region size, aborting\n");
-		goto iospace_error_exit;
-	}
-
-	if (pci_request_regions(ha->pdev, DRIVER_NAME)) {
-		dev_warn(&ha->pdev->dev,
-			 "Failed to reserve PIO/MMIO regions\n");
-		goto iospace_error_exit;
-	}
-
-	ha->pio_address = pio;
-	ha->pio_length = pio_len;
-	ha->reg = ioremap(mmio, MIN_IOBASE_LEN);
-	if (!ha->reg) {
-		dev_err(&ha->pdev->dev, "cannot remap MMIO, aborting\n");
-		goto iospace_error_exit;
-	}
-
-	return 0;
-
-iospace_error_exit:
-	return -ENOMEM;
-}
-
 /**
  * qla4xxx_config_dma_addressing() - Configure OS DMA addressing method.
  * @ha: HA context

  parent reply	other threads:[~2006-08-09 18:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-09 18:24 [PATCHSET] qla4xxx: more qla4xxx cleanup Doug Maxey
2006-08-09 18:42 ` [PATCH 1/3] qla4xxx: clarify doc for probe_adapter Doug Maxey
2006-08-09 18:42 ` [PATCH 2/3] qla4xxx: really move free_adapter Doug Maxey
2006-08-09 18:42 ` Doug Maxey [this message]
2006-08-09 17:56   ` [PATCH 3/3] qla4xxx: iospace_config move defn Mike Christie
2006-08-09 18:03     ` Mike Christie
2006-08-09 20:38       ` Doug Maxey
2006-08-09 19:23     ` David C Somayajulu
2006-08-09 20:15       ` Andrew Vasquez
2006-08-09 20:21         ` James Bottomley
2006-08-09 22:16           ` David C Somayajulu

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=20060809184243.2021.48891.stgit@bebe.enoyolf.org \
    --to=dwm@enoyolf.org \
    --cc=david.somayajulu@qlogic.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=open-iscsi@googlegroups.com \
    --cc=ravi.anand@qlogic.com \
    /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