ide: add IDE_HFLAG_4DRIVES host flag
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:28 +0000 (12:46 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:28 +0000 (12:46 +0100)
Add IDE_HFLAG_4DRIVES host flag and use it instead of ide_4drives
chipset type in ide_init_port().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-4drives.c
drivers/ide/ide-probe.c
include/linux/ide.h

index 9e85b1ec9607604178a6a99419b2449516027f5d..78aca75a2c487ece474e08bcb220c5542caa8b4b 100644 (file)
@@ -23,7 +23,8 @@ static const struct ide_port_ops ide_4drives_port_ops = {
 
 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,
+       .host_flags             = IDE_HFLAG_SERIALIZE | IDE_HFLAG_NO_DMA |
+                                 IDE_HFLAG_4DRIVES,
 };
 
 static int __init ide_4drives_init(void)
index 62270f474681820852cbd6ef9dfde7595cc65d3d..335322f40c5a1ea5a777811213f3869fc15d5cda 100644 (file)
@@ -1381,8 +1381,8 @@ int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
                if (ide_probe_port(hwif) == 0)
                        hwif->present = 1;
 
-               if (hwif->chipset != ide_4drives || !hwif->mate ||
-                   !hwif->mate->present) {
+               if ((hwif->host_flags & IDE_HFLAG_4DRIVES) == 0 ||
+                   hwif->mate == NULL || hwif->mate->present == 0) {
                        if (ide_register_port(hwif)) {
                                ide_disable_port(hwif);
                                continue;
index 732a05f3de089d59aab5aa0039d61e75a720c86f..3d4ba8e95d4aca3975ac1c059e6b36cc60b33884 100644 (file)
@@ -1327,6 +1327,8 @@ enum {
        IDE_HFLAG_SERIALIZE             = (1 << 20),
        /* host is DTC2278 */
        IDE_HFLAG_DTC2278               = (1 << 21),
+       /* 4 devices on a single set of I/O ports */
+       IDE_HFLAG_4DRIVES               = (1 << 22),
        /* host is TRM290 */
        IDE_HFLAG_TRM290                = (1 << 23),
        /* use 32-bit I/O ops */