From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Jeremy Higdon <jeremy@sgi.com>
Subject: [PATCH 5/5] sgiioc4: call ide_find_port_slot() later
Date: Wed, 11 Jun 2008 21:22:45 +0200 [thread overview]
Message-ID: <200806112122.45788.bzolnier@gmail.com> (raw)
Move ide_find_port_slot() call closer to ide_device_add().
This is basically a preparation for the future changes.
Cc: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/pci/sgiioc4.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
Index: b/drivers/ide/pci/sgiioc4.c
===================================================================
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -588,10 +588,6 @@ sgiioc4_ide_setup_pci_device(struct pci_
hw_regs_t hw;
struct ide_port_info d = sgiioc4_port_info;
- hwif = ide_find_port_slot(&d);
- if (hwif == NULL)
- return -ENOMEM;
-
/* Get the CmdBlk and CtrlBlk Base Registers */
bar0 = pci_resource_start(dev, 0);
virt_base = ioremap(bar0, pci_resource_len(dev, 0));
@@ -621,6 +617,11 @@ sgiioc4_ide_setup_pci_device(struct pci_
hw.irq = dev->irq;
hw.chipset = ide_pci;
hw.dev = &dev->dev;
+
+ hwif = ide_find_port_slot(&d);
+ if (hwif == NULL)
+ goto err;
+
ide_init_port_hw(hwif, &hw);
/* The IOC4 uses MMIO rather than Port IO. */
@@ -637,6 +638,10 @@ sgiioc4_ide_setup_pci_device(struct pci_
return -EIO;
return 0;
+err:
+ release_mem_region(cmd_phys_base, IOC4_CMD_CTL_BLK_SIZE);
+ iounmap(virt_base);
+ return -ENOMEM;
}
static unsigned int __devinit
reply other threads:[~2008-06-11 20:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200806112122.45788.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=jeremy@sgi.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 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.