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 8/9] ide_4drives: use struct ide_port_info
Date: Mon, 02 Jun 2008 22:23:56 +0200	[thread overview]
Message-ID: <20080602202356.7265.68692.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080602202253.7265.23590.sendpatchset@localhost.localdomain>

Convert the driver to use struct ide_port_info - as a nice side-effect
this fixes hwif->channel initialization.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/legacy/ide-4drives.c |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

Index: b/drivers/ide/legacy/ide-4drives.c
===================================================================
--- a/drivers/ide/legacy/ide-4drives.c
+++ b/drivers/ide/legacy/ide-4drives.c
@@ -11,6 +11,23 @@ static int probe_4drives;
 module_param_named(probe, probe_4drives, bool, 0);
 MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port");
 
+static void ide_4drives_port_init_devs(ide_hwif_t *hwif)
+{
+	if (hwif->channel) {
+		hwif->drives[0].select.all ^= 0x20;
+		hwif->drives[1].select.all ^= 0x20;
+	}
+}
+
+static const struct ide_port_ops ide_4drives_port_ops = {
+	.port_init_devs		= ide_4drives_port_init_devs,
+};
+
+static const struct ide_port_info ide_4drives_port_info = {
+	.port_ops		= &ide_4drives_port_ops,
+	.host_flags		= IDE_HFLAG_SERIALIZE | IDE_HFLAG_NO_DMA,
+};
+
 static int __init ide_4drives_init(void)
 {
 	ide_hwif_t *hwif, *mate;
@@ -49,18 +66,10 @@ static int __init ide_4drives_init(void)
 	mate = ide_find_port();
 	if (mate) {
 		ide_init_port_hw(mate, &hw);
-		mate->drives[0].select.all ^= 0x20;
-		mate->drives[1].select.all ^= 0x20;
 		idx[1] = mate->index;
-
-		if (hwif) {
-			hwif->mate = mate;
-			mate->mate = hwif;
-			hwif->serialized = mate->serialized = 1;
-		}
 	}
 
-	ide_device_add(idx, NULL);
+	ide_device_add(idx, &ide_4drives_port_info);
 
 	return 0;
 }

  parent reply	other threads:[~2008-06-02 20:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02 20:22 [PATCH 1/9] ide: fix host drivers missing hwif->chipset initialization Bartlomiej Zolnierkiewicz
2008-06-02 20:23 ` [PATCH 2/9] ide: set hwif->dev in ide_init_port_hw() Bartlomiej Zolnierkiewicz
2008-06-02 20:23 ` [PATCH 3/9] delkin_cb: set proper hwif->gendev.parent value Bartlomiej Zolnierkiewicz
2008-06-04  9:41   ` Sergei Shtylyov
2008-06-02 20:23 ` [PATCH 4/9] delkin_cb: use struct ide_port_info Bartlomiej Zolnierkiewicz
2008-06-02 20:23 ` [PATCH 5/9] delkin_cb: add warm-plug support Bartlomiej Zolnierkiewicz
2008-06-02 20:23 ` [PATCH 6/9] delkin_cb: add missing __init/__exit tags Bartlomiej Zolnierkiewicz
2008-06-04  9:42   ` Sergei Shtylyov
2008-06-02 20:23 ` [PATCH 7/9] au1xxx-ide: don't use hwif->hwif_data Bartlomiej Zolnierkiewicz
2008-06-04  9:43   ` Sergei Shtylyov
2008-06-02 20:23 ` Bartlomiej Zolnierkiewicz [this message]
2008-06-02 20:24 ` [PATCH 9/9] ide-cs: use struct ide_port_info 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=20080602202356.7265.68692.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).