linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 07/14] ide: print message on error in ide_find_port_slot()
Date: Tue, 10 Jun 2008 22:51:59 +0200	[thread overview]
Message-ID: <20080610205159.18469.72812.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080610205059.18469.44856.sendpatchset@localhost.localdomain>

* Add DRV_NAME define to ide-h8300.c.

* Fix ide-h8300.c, swarm.c and sgiioc4.c to set .name field in
  struct ide_port_info to DRV_NAME, then convert these host drivers
  to use ide_find_port_slot() instead of ide_find_port().

* Print message on error in ide_find_port_slot().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/h8300/ide-h8300.c |    8 ++++----
 drivers/ide/ide-probe.c       |    3 +++
 drivers/ide/mips/swarm.c      |    7 +++----
 drivers/ide/pci/scc_pata.c    |    7 ++-----
 drivers/ide/pci/sgiioc4.c     |    8 +++-----
 drivers/ide/setup-pci.c       |    5 +----
 6 files changed, 16 insertions(+), 22 deletions(-)

Index: b/drivers/ide/h8300/ide-h8300.c
===================================================================
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -8,6 +8,8 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
+#define DRV_NAME "ide-h8300"
+
 #define bswap(d) \
 ({					\
 	u16 r;				\
@@ -196,11 +198,9 @@ static int __init h8300_ide_init(void)
 
 	hw_setup(&hw);
 
-	hwif = ide_find_port();
-	if (hwif == NULL) {
-		printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
+	hwif = ide_find_port_slot(&h8300_port_info);
+	if (hwif == NULL)
 		return -ENOENT;
-	}
 
 	index = hwif->index;
 	ide_init_port_hw(hwif, &hw);
Index: b/drivers/ide/ide-probe.c
===================================================================
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1496,6 +1496,9 @@ ide_hwif_t *ide_find_port_slot(const str
 		}
 	}
 
+	printk(KERN_ERR "%s: no free slot for interface\n",
+			d ? d->name : "ide");
+
 	return NULL;
 
 out_found:
Index: b/drivers/ide/mips/swarm.c
===================================================================
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -62,6 +62,7 @@ static struct resource swarm_ide_resourc
 static struct platform_device *swarm_ide_dev;
 
 static const struct ide_port_info swarm_port_info = {
+	.name			= DRV_NAME,
 	.host_flags		= IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA,
 };
 
@@ -81,11 +82,9 @@ static int __devinit swarm_ide_probe(str
 	if (!SIBYTE_HAVE_IDE)
 		return -ENODEV;
 
-	hwif = ide_find_port();
-	if (hwif == NULL) {
-		printk(KERN_ERR DRV_NAME ": no free slot for interface\n");
+	hwif = ide_find_port_slot(&swarm_port_info);
+	if (hwif == NULL)
 		return -ENOMEM;
-	}
 
 	base = ioremap(A_IO_EXT_BASE, 0x800);
 	offset = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_START_ADDR, IDE_CS));
Index: b/drivers/ide/pci/scc_pata.c
===================================================================
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -558,12 +558,9 @@ static int scc_ide_setup_pci_device(stru
 	u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 	int i;
 
-	hwif = ide_find_port();
-	if (hwif == NULL) {
-		printk(KERN_ERR "%s: too many IDE interfaces, "
-				"no room in table\n", SCC_PATA_NAME);
+	hwif = ide_find_port_slot(d);
+	if (hwif == NULL)
 		return -ENOMEM;
-	}
 
 	memset(&hw, 0, sizeof(hw));
 	for (i = 0; i <= 8; i++)
Index: b/drivers/ide/pci/sgiioc4.c
===================================================================
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -568,6 +568,7 @@ static const struct ide_dma_ops sgiioc4_
 };
 
 static const struct ide_port_info sgiioc4_port_info __devinitdata = {
+	.name			= DRV_NAME,
 	.chipset		= ide_pci,
 	.init_dma		= ide_dma_sgiioc4,
 	.port_ops		= &sgiioc4_port_ops,
@@ -587,12 +588,9 @@ sgiioc4_ide_setup_pci_device(struct pci_
 	hw_regs_t hw;
 	struct ide_port_info d = sgiioc4_port_info;
 
-	hwif = ide_find_port();
-	if (hwif == NULL) {
-		printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n",
-				DRV_NAME);
+	hwif = ide_find_port_slot(&d);
+	if (hwif == NULL)
 		return -ENOMEM;
-	}
 
 	/*  Get the CmdBlk and CtrlBlk Base Registers */
 	bar0 = pci_resource_start(dev, 0);
Index: b/drivers/ide/setup-pci.c
===================================================================
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -332,11 +332,8 @@ static ide_hwif_t *ide_hwif_configure(st
 	}
 
 	hwif = ide_find_port_slot(d);
-	if (hwif == NULL) {
-		printk(KERN_ERR "%s: too many IDE interfaces, no room in "
-				"table\n", d->name);
+	if (hwif == NULL)
 		return NULL;
-	}
 
 	memset(&hw, 0, sizeof(hw));
 	hw.irq = irq;

  parent reply	other threads:[~2008-06-10 20:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10 20:50 [PATCH 01/14] cmd640: fix warm-plug support for the secondary interface Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 02/14] ide: ->port_init_devs -> ->init_dev Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 03/14] cmd640: add ->init_dev method Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 04/14] rapide: use struct ide_port_info Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 05/14] ide-h8300: " Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` [PATCH 06/14] ide_platform: " Bartlomiej Zolnierkiewicz
2008-06-10 20:51 ` Bartlomiej Zolnierkiewicz [this message]
2008-06-10 20:52 ` [PATCH 08/14] ide-h8300: print driver banner message early Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 09/14] ide-pnp: " Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 10/14] ide: allow any command requesting DMA data phase for HDIO_DRIVE_TASKFILE Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 11/14] ide: remove superfluous BUG_ON() from set_geometry_intr() Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 12/14] ide: remove needless includes from ide.c Bartlomiej Zolnierkiewicz
2008-06-10 20:52 ` [PATCH 13/14] ide: remove needless includes from ide-taskfile.c Bartlomiej Zolnierkiewicz
2008-06-10 20:53 ` [PATCH 14/14] ide: remove needless includes from setup-pci.c Bartlomiej Zolnierkiewicz

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=20080610205159.18469.72812.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).