From: Alan Cox <alan@redhat.com>
To: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
torvalds@osdl.org
Subject: PATCH: convert ide_cs to new unregister_hwif logic
Date: Sun, 15 Aug 2004 11:15:31 -0400 [thread overview]
Message-ID: <20040815151531.GA15748@devserv.devel.redhat.com> (raw)
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.8-rc3/drivers/ide/legacy/ide-cs.c linux-2.6.8-rc3/drivers/ide/legacy/ide-cs.c
--- linux.vanilla-2.6.8-rc3/drivers/ide/legacy/ide-cs.c 2004-08-09 15:51:00.000000000 +0100
+++ linux-2.6.8-rc3/drivers/ide/legacy/ide-cs.c 2004-08-10 16:43:56.000000000 +0100
@@ -90,6 +90,7 @@
int ndev;
dev_node_t node;
int hd;
+ ide_hwif_t *hwif;
} ide_info_t;
static void ide_release(dev_link_t *);
@@ -199,14 +200,14 @@
} /* ide_detach */
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq)
+static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, ide_hwif_t **hwif)
{
hw_regs_t hw;
memset(&hw, 0, sizeof(hw));
ide_init_hwif_ports(&hw, io, ctl, NULL);
hw.irq = irq;
hw.chipset = ide_pci;
- return ide_register_hw(&hw, NULL);
+ return ide_register_hw(&hw, hwif);
}
/*======================================================================
@@ -224,6 +225,7 @@
{
client_handle_t handle = link->handle;
ide_info_t *info = link->priv;
+ ide_hwif_t *hwif;
tuple_t tuple;
struct {
u_short buf[128];
@@ -343,14 +345,17 @@
if (is_kme)
outb(0x81, ctl_base+1);
- /* retry registration in case device is still spinning up */
+ /* retry registration in case device is still spinning up
+
+ FIXME: now handled by IDE layer... ?? */
+
for (hd = -1, i = 0; i < 10; i++) {
- hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ);
+ hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, &hwif);
if (hd >= 0) break;
if (link->io.NumPorts1 == 0x20) {
outb(0x02, ctl_base + 0x10);
hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
- link->irq.AssignedIRQ);
+ link->irq.AssignedIRQ, &hwif);
if (hd >= 0) {
io_base += 0x10;
ctl_base += 0x10;
@@ -373,6 +378,7 @@
info->node.major = ide_major[hd];
info->node.minor = 0;
info->hd = hd;
+ info->hwif = hwif;
link->dev = &info->node;
printk(KERN_INFO "ide-cs: %s: Vcc = %d.%d, Vpp = %d.%d\n",
info->node.dev_name, link->conf.Vcc / 10, link->conf.Vcc % 10,
@@ -411,7 +417,7 @@
if (info->ndev) {
/* FIXME: if this fails we need to queue the cleanup somehow
-- need to investigate the required PCMCIA magic */
- ide_unregister(info->hd);
+ ide_unregister_hwif(info->hwif);
/* deal with brain dead IDE resource management */
request_region(link->io.BasePort1, link->io.NumPorts1,
info->node.dev_name);
Signed-off-by: Alan Cox <alan@redhat.com>
reply other threads:[~2004-08-15 15:16 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=20040815151531.GA15748@devserv.devel.redhat.com \
--to=alan@redhat.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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.