ide: add ide_pci_device_t.host_flags (take 2)
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 19 Jul 2007 23:11:55 +0000 (01:11 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 19 Jul 2007 23:11:55 +0000 (01:11 +0200)
* Rename ide_pci_device_t.flags to ide_pci_device_t.host_flags
  and IDEPCI_FLAG_ISA_PORTS flag to IDE_HFLAG_ISA_PORTS.

* Add IDE_HFLAG_SINGLE flag for single channel devices.

* Convert core code and all IDE PCI drivers to use IDE_HFLAG_SINGLE
  and remove no longer needed ide_pci_device_t.channels field.

v2:
* Fix issues noticed by Sergei:
  - correct code alignment in scc_pata.c
  - s/IDE_HFLAG_SINGLE/~IDE_HFLAG_SINGLE/ in serverworks.c

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
35 files changed:
drivers/ide/pci/aec62xx.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cs5535.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/generic.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/it8213.c
drivers/ide/pci/it821x.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/ns87415.c
drivers/ide/pci/opti621.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/piix.c
drivers/ide/pci/rz1000.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/scc_pata.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/sl82c105.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/tc86c001.c
drivers/ide/pci/triflex.c
drivers/ide/pci/trm290.c
drivers/ide/pci/via82cxxx.c
drivers/ide/setup-pci.c
include/linux/ide.h

index 6d18fef558bdb6f1c74880ede0482843a2e535cf..f8ac91c22e64999a4784891f4556e392c3288c30 100644 (file)
@@ -265,7 +265,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_setup     = init_setup_aec62xx,
                .init_chipset   = init_chipset_aec62xx,
                .init_hwif      = init_hwif_aec62xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .bootable       = OFF_BOARD,
@@ -275,7 +274,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_setup     = init_setup_aec62xx,
                .init_chipset   = init_chipset_aec62xx,
                .init_hwif      = init_hwif_aec62xx,
-               .channels       = 2,
                .autodma        = NOAUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x1f, /* udma0-4 */
@@ -284,7 +282,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_setup     = init_setup_aec62xx,
                .init_chipset   = init_chipset_aec62xx,
                .init_hwif      = init_hwif_aec62xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .bootable       = NEVER_BOARD,
@@ -294,7 +291,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_setup     = init_setup_aec6x80,
                .init_chipset   = init_chipset_aec62xx,
                .init_hwif      = init_hwif_aec62xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x3f, /* udma0-5 */
@@ -303,7 +299,6 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_setup     = init_setup_aec6x80,
                .init_chipset   = init_chipset_aec62xx,
                .init_hwif      = init_hwif_aec62xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .bootable       = OFF_BOARD,
index ba0fb92b041770870dbfb5e49bdb0e2c28480f14..1012da6e8a42abb4ffaf952db6c052602261fba7 100644 (file)
@@ -817,7 +817,6 @@ static ide_pci_device_t ali15x3_chipset __devinitdata = {
        .init_chipset   = init_chipset_ali15x3,
        .init_hwif      = init_hwif_ali15x3,
        .init_dma       = init_dma_ali15x3,
-       .channels       = 2,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
 };
index 8d30b99a54d8cca8e9db1aad2cb719a16f3a6916..9c3ea90aeb8bf931c5b55aa901470ab96e539567 100644 (file)
@@ -448,7 +448,6 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                .name           = name_str,                             \
                .init_chipset   = init_chipset_amd74xx,                 \
                .init_hwif      = init_hwif_amd74xx,                    \
-               .channels       = 2,                                    \
                .autodma        = AUTODMA,                              \
                .enablebits     = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \
                .bootable       = ON_BOARD,                             \
@@ -459,7 +458,6 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                .name           = name_str,                             \
                .init_chipset   = init_chipset_amd74xx,                 \
                .init_hwif      = init_hwif_amd74xx,                    \
-               .channels       = 2,                                    \
                .autodma        = AUTODMA,                              \
                .enablebits     = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \
                .bootable       = ON_BOARD,                             \
index bfdf086f45253b8ea32feb14983b428f69f0221f..078adbe250d2e1093321cf0b43541fcee505da91 100644 (file)
@@ -291,17 +291,16 @@ static ide_pci_device_t atiixp_pci_info[] __devinitdata = {
        {       /* 0 */
                .name           = "ATIIXP",
                .init_hwif      = init_hwif_atiixp,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x48,0x01,0x00}, {0x48,0x08,0x00}},
                .bootable       = ON_BOARD,
        },{     /* 1 */
                .name           = "SB600_PATA",
                .init_hwif      = init_hwif_atiixp,
-               .channels       = 1,
                .autodma        = AUTODMA,
                .enablebits     = {{0x48,0x01,0x00}, {0x00,0x00,0x00}},
                .bootable       = ON_BOARD,
+               .host_flags     = IDE_HFLAG_SINGLE,
        },
 };
 
index 5171e94facdc12963d50396fe24834a078f07a2d..8150a023dd7ab9c02e69dcd364da97b38143b1a5 100644 (file)
@@ -617,7 +617,6 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .init_setup     = init_setup_cmd64x,
                .init_chipset   = init_chipset_cmd64x,
                .init_hwif      = init_hwif_cmd64x,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
                .bootable       = ON_BOARD,
@@ -627,7 +626,6 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .init_setup     = init_setup_cmd646,
                .init_chipset   = init_chipset_cmd64x,
                .init_hwif      = init_hwif_cmd64x,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
                .bootable       = ON_BOARD,
@@ -637,7 +635,6 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .init_setup     = init_setup_cmd64x,
                .init_chipset   = init_chipset_cmd64x,
                .init_hwif      = init_hwif_cmd64x,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
                .bootable       = ON_BOARD,
@@ -647,7 +644,6 @@ static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
                .init_setup     = init_setup_cmd64x,
                .init_chipset   = init_chipset_cmd64x,
                .init_hwif      = init_hwif_cmd64x,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
                .bootable       = ON_BOARD,
index 3b88a3a561167c3986b8a0815c1b3161fec8ba7f..5539a25eae99290c6281d30c1bf379182316c0de 100644 (file)
@@ -194,10 +194,9 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
                .name           = name_str,                     \
                .init_setup_dma = cs5520_init_setup_dma,        \
                .init_hwif      = init_hwif_cs5520,             \
-               .channels       = 2,                            \
                .autodma        = AUTODMA,                      \
                .bootable       = ON_BOARD,                     \
-               .flags          = IDEPCI_FLAG_ISA_PORTS,        \
+               .host_flags     = IDE_HFLAG_ISA_PORTS,          \
        }
 
 static ide_pci_device_t cyrix_chipsets[] __devinitdata = {
index b5c00d15a70403ffdbc829c71d3b0ff4137c0d9b..643d66cc672963c61b46fc2dce437e41e739717b 100644 (file)
@@ -341,7 +341,6 @@ static ide_pci_device_t cs5530_chipset __devinitdata = {
        .name           = "CS5530",
        .init_chipset   = init_chipset_cs5530,
        .init_hwif      = init_hwif_cs5530,
-       .channels       = 2,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
 };
index 10f61f38243cbc6242ee1b33c2634b1cdca6a8e1..5039793721446b3190ec8230082fe11fd70e9ea3 100644 (file)
@@ -228,9 +228,9 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
 static ide_pci_device_t cs5535_chipset __devinitdata = {
        .name           = "CS5535",
        .init_hwif      = init_hwif_cs5535,
-       .channels       = 1,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
+       .host_flags     = IDE_HFLAG_SINGLE,
 };
 
 static int __devinit cs5535_init_one(struct pci_dev *dev,
index 103b9db97853046d38550e7c496de20a47460113..995b7256361335c88dfb3a670951ef285a00352e 100644 (file)
@@ -483,9 +483,9 @@ static ide_pci_device_t cy82c693_chipset __devinitdata = {
        .init_chipset   = init_chipset_cy82c693,
        .init_iops      = init_iops_cy82c693,
        .init_hwif      = init_hwif_cy82c693,
-       .channels       = 1,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
+       .host_flags     = IDE_HFLAG_SINGLE,
 };
 
 static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 0d51a11e81da6edc8342ef33928a49b5740af8ec..48caa468b7629b00eecad7663724048287f7de4b 100644 (file)
@@ -95,92 +95,77 @@ static ide_pci_device_t generic_chipsets[] __devinitdata = {
        {       /* 0 */
                .name           = "Unknown",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 1 */
                .name           = "NS87410",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
                .bootable       = ON_BOARD,
         },{    /* 2 */
                .name           = "SAMURAI",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 3 */
                .name           = "HT6565",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 4 */
                .name           = "UM8673F",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NODMA,
                .bootable       = ON_BOARD,
        },{     /* 5 */
                .name           = "UM8886A",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NODMA,
                .bootable       = ON_BOARD,
        },{     /* 6 */
                .name           = "UM8886BF",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NODMA,
                .bootable       = ON_BOARD,
        },{     /* 7 */
                .name           = "HINT_IDE",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 8 */
                .name           = "VIA_IDE",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NOAUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 9 */
                .name           = "OPTI621V",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NOAUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 10 */
                .name           = "VIA8237SATA",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
        },{     /* 11 */
                .name           = "Piccolo0102",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NOAUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 12 */
                .name           = "Piccolo0103",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NOAUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 13 */
                .name           = "Piccolo0105",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = NOAUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 14 */
                .name           = "Revolution",
                .init_hwif      = init_hwif_generic,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
        }
index 64f19743b127601e01a99bf3d0ca7dbf6c0928a9..6d2ef0ee0f2b69403615475c8f600f0db54720cf 100644 (file)
@@ -175,7 +175,6 @@ static ide_pci_device_t hpt34x_chipset __devinitdata = {
        .name           = "HPT34X",
        .init_chipset   = init_chipset_hpt34x,
        .init_hwif      = init_hwif_hpt34x,
-       .channels       = 2,
        .autodma        = NOAUTODMA,
        .bootable       = NEVER_BOARD,
        .extra          = 16
index 81853d740aeeaa29ddb317454478fd7fb7e34ed2..182346a04f36feaf5043b902f88e730eea7a0cb8 100644 (file)
@@ -1483,7 +1483,7 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d)
                 * to both functions -- really stupid design decision... :-(
                 * Bit 4 is for the primary channel, bit 5 for the secondary.
                 */
-               d->channels = 1;
+               d->host_flags |= IDE_HFLAG_SINGLE;
                d->enablebits[0].mask = d->enablebits[0].val = 0x10;
 
                d->udma_mask = HPT366_ALLOW_ATA66_3 ?
@@ -1546,7 +1546,6 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_hpt366,
                .init_hwif      = init_hwif_hpt366,
                .init_dma       = init_dma_hpt366,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
                .bootable       = OFF_BOARD,
@@ -1557,7 +1556,6 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_hpt366,
                .init_hwif      = init_hwif_hpt366,
                .init_dma       = init_dma_hpt366,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
                .udma_mask      = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f,
@@ -1569,7 +1567,6 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_hpt366,
                .init_hwif      = init_hwif_hpt366,
                .init_dma       = init_dma_hpt366,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
                .udma_mask      = HPT302_ALLOW_ATA133_6 ? 0x7f : 0x3f,
@@ -1581,7 +1578,6 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_hpt366,
                .init_hwif      = init_hwif_hpt366,
                .init_dma       = init_dma_hpt366,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
                .udma_mask      = HPT371_ALLOW_ATA133_6 ? 0x7f : 0x3f,
@@ -1593,7 +1589,6 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_hpt366,
                .init_hwif      = init_hwif_hpt366,
                .init_dma       = init_dma_hpt366,
-               .channels       = 2,    /* 4 */
                .autodma        = AUTODMA,
                .enablebits     = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
                .udma_mask      = 0x3f,
@@ -1605,7 +1600,6 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_hpt366,
                .init_hwif      = init_hwif_hpt366,
                .init_dma       = init_dma_hpt366,
-               .channels       = 2,    /* 4 */
                .autodma        = AUTODMA,
                .enablebits     = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
                .udma_mask      = HPT372_ALLOW_ATA133_6 ? 0x7f : 0x3f,
index ff48c23e571ea03ad6506437b3ece40f3afedd47..684b0ec79f41b6cb5a55af382ab333dc45db2e77 100644 (file)
@@ -272,10 +272,10 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
        {                                               \
                .name           = name_str,             \
                .init_hwif      = init_hwif_it8213,     \
-               .channels       = 1,                    \
                .autodma        = AUTODMA,              \
                .enablebits     = {{0x41,0x80,0x80}}, \
                .bootable       = ON_BOARD,             \
+               .host_flags     = IDE_HFLAG_SINGLE,     \
        }
 
 static ide_pci_device_t it8213_chipsets[] __devinitdata = {
index 8197b653ba1ed8cbb67e450ed6d5af628a21dd40..faccb2d4af43abb5fddf41343875257d56289367 100644 (file)
@@ -718,7 +718,6 @@ static unsigned int __devinit init_chipset_it821x(struct pci_dev *dev, const cha
                .name           = name_str,             \
                .init_chipset   = init_chipset_it821x,  \
                .init_hwif      = init_hwif_it821x,     \
-               .channels       = 2,                    \
                .autodma        = AUTODMA,              \
                .bootable       = ON_BOARD,             \
                .fixup          = it821x_fixups         \
index a6008f63e71ef677721411e7d2f36cb1696e9141..0edb9cd458544ad5438fa28f1dc6b98e5afdfefa 100644 (file)
@@ -177,7 +177,6 @@ fallback:
        {                                               \
                .name           = name_str,             \
                .init_hwif      = init_hwif_jmicron,    \
-               .channels       = 2,                    \
                .autodma        = AUTODMA,              \
                .bootable       = ON_BOARD,             \
                .enablebits     = { {0x40, 1, 1}, {0x40, 0x10, 0x10} }, \
index b310c4f510773c6f8aa2c9961fd72a7d7261b8ce..09941f37d635d28146639ada84b49c4494ce8607 100644 (file)
@@ -281,7 +281,6 @@ static ide_pci_device_t ns87415_chipset __devinitdata = {
        .init_iops      = init_iops_ns87415,
 #endif
        .init_hwif      = init_hwif_ns87415,
-       .channels       = 2,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
 };
index aede7eee9246fc087daa5c3c1541563a031a4e0f..78d7adf2d0b06eb801d6e9719bb4cce61233bd45 100644 (file)
@@ -350,14 +350,12 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = {
        {       /* 0 */
                .name           = "OPTI621",
                .init_hwif      = init_hwif_opti621,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
                .bootable       = ON_BOARD,
        },{     /* 1 */
                .name           = "OPTI621X",
                .init_hwif      = init_hwif_opti621,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
                .bootable       = ON_BOARD,
index 06c5e93d37a2fe112403814d34bfb85ecf28d734..f8508d9cccd31239948c510aa1c8b931b715fa07 100644 (file)
@@ -566,7 +566,6 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_setup     = init_setup_pdcnew,
                .init_chipset   = init_chipset_pdcnew,
                .init_hwif      = init_hwif_pdc202new,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x3f, /* udma0-5 */
@@ -575,7 +574,6 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_setup     = init_setup_pdcnew,
                .init_chipset   = init_chipset_pdcnew,
                .init_hwif      = init_hwif_pdc202new,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x7f, /* udma0-6*/
@@ -584,7 +582,6 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_setup     = init_setup_pdc20270,
                .init_chipset   = init_chipset_pdcnew,
                .init_hwif      = init_hwif_pdc202new,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x3f, /* udma0-5 */
@@ -593,7 +590,6 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_setup     = init_setup_pdcnew,
                .init_chipset   = init_chipset_pdcnew,
                .init_hwif      = init_hwif_pdc202new,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x7f, /* udma0-6*/
@@ -602,7 +598,6 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_setup     = init_setup_pdcnew,
                .init_chipset   = init_chipset_pdcnew,
                .init_hwif      = init_hwif_pdc202new,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x7f, /* udma0-6*/
@@ -611,7 +606,6 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_setup     = init_setup_pdc20276,
                .init_chipset   = init_chipset_pdcnew,
                .init_hwif      = init_hwif_pdc202new,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x7f, /* udma0-6*/
@@ -620,7 +614,6 @@ static ide_pci_device_t pdcnew_chipsets[] __devinitdata = {
                .init_setup     = init_setup_pdcnew,
                .init_chipset   = init_chipset_pdcnew,
                .init_hwif      = init_hwif_pdc202new,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .udma_mask      = 0x7f, /* udma0-6*/
index 25cebfe18dddb43f5d8bd13642fcaca996ef4de3..eb4e4a61d06e73a8d5ee70e2dc0e175cc0de686c 100644 (file)
@@ -441,7 +441,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_pdc202xx,
                .init_hwif      = init_hwif_pdc202xx,
                .init_dma       = init_dma_pdc202xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .extra          = 16,
@@ -452,7 +451,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_pdc202xx,
                .init_hwif      = init_hwif_pdc202xx,
                .init_dma       = init_dma_pdc202xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .extra          = 48,
@@ -463,7 +461,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_pdc202xx,
                .init_hwif      = init_hwif_pdc202xx,
                .init_dma       = init_dma_pdc202xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .extra          = 48,
@@ -474,7 +471,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_pdc202xx,
                .init_hwif      = init_hwif_pdc202xx,
                .init_dma       = init_dma_pdc202xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .extra          = 48,
@@ -485,7 +481,6 @@ static ide_pci_device_t pdc202xx_chipsets[] __devinitdata = {
                .init_chipset   = init_chipset_pdc202xx,
                .init_hwif      = init_hwif_pdc202xx,
                .init_dma       = init_dma_pdc202xx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
                .extra          = 48,
index 1372c35be035fcc898cb1fe708f8056c56079fde..a4f88d25b16d344085fa735b10de16cd3126ad34 100644 (file)
@@ -495,7 +495,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
                .name           = name_str,             \
                .init_chipset   = init_chipset_piix,    \
                .init_hwif      = init_hwif_piix,       \
-               .channels       = 2,                    \
                .autodma        = AUTODMA,              \
                .enablebits     = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \
                .bootable       = ON_BOARD,             \
@@ -514,11 +513,10 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
                 */
                .name           = "MPIIX",
                .init_hwif      = init_hwif_piix,
-               .channels       = 2,
                .autodma        = NODMA,
                .enablebits     = {{0x6d,0xc0,0x80}, {0x6d,0xc0,0xc0}},
                .bootable       = ON_BOARD,
-               .flags          = IDEPCI_FLAG_ISA_PORTS
+               .host_flags     = IDE_HFLAG_ISA_PORTS,
        },
 
        /*  3 */ DECLARE_PIIX_DEV("PIIX3", 0x00),       /* no udma */
index f8c954690142265fcb4202f06445e340a4e5b8a5..10e1ae7a4a0272c1e38784fa6727b8e1c759cf69 100644 (file)
@@ -52,7 +52,6 @@ static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
 static ide_pci_device_t rz1000_chipset __devinitdata = {
        .name           = "RZ100x",
        .init_hwif      = init_hwif_rz1000,
-       .channels       = 2,
        .autodma        = NODMA,
        .bootable       = ON_BOARD,
 };
index 523363c93794d72b644286672fe9d7a01028f8dc..7dbc44cc722a27f9df8b2578a98127ecec8531a0 100644 (file)
@@ -471,7 +471,6 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
 static ide_pci_device_t sc1200_chipset __devinitdata = {
        .name           = "SC1200",
        .init_hwif      = init_hwif_sc1200,
-       .channels       = 2,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
 };
index fd4b1a24ecabebfa4534a23acdcf76a1e1b7cdc5..a1954d1c287987c03403ccdbea926519444c240f 100644 (file)
@@ -772,9 +772,9 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
       .init_setup      = init_setup_scc,               \
       .init_iops       = init_iops_scc,                \
       .init_hwif       = init_hwif_scc,                \
-      .channels        = 1,                                    \
       .autodma = AUTODMA,                              \
       .bootable        = ON_BOARD,                             \
+      .host_flags      = IDE_HFLAG_SINGLE,             \
   }
 
 static ide_pci_device_t scc_chipsets[] __devinitdata = {
index ed04e0c8dd4c491ae71f3f4b4821de6aa5e5ee97..809deb92bc115649ace971e2d2dbffaeae202d6c 100644 (file)
@@ -441,9 +441,12 @@ static int __devinit init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d)
                        d->bootable = ON_BOARD;
        }
 
-       d->channels = ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE ||
-                       dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2) &&
-                      (!(PCI_FUNC(dev->devfn) & 1))) ? 1 : 2;
+       if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE ||
+           dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2) &&
+           (!(PCI_FUNC(dev->devfn) & 1)))
+               d->host_flags |= IDE_HFLAG_SINGLE;
+       else
+               d->host_flags &= ~IDE_HFLAG_SINGLE;
 
        return ide_setup_pci_device(dev, d);
 }
@@ -454,7 +457,6 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_svwks,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 1 */
@@ -462,7 +464,6 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_svwks,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 2 */
@@ -470,7 +471,6 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_csb6,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
        },{     /* 3 */
@@ -478,17 +478,17 @@ static ide_pci_device_t serverworks_chipsets[] __devinitdata = {
                .init_setup     = init_setup_csb6,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .channels       = 1,    /* 2 */
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
+               .host_flags     = IDE_HFLAG_SINGLE,
        },{     /* 4 */
                .name           = "SvrWks HT1000",
                .init_setup     = init_setup_svwks,
                .init_chipset   = init_chipset_svwks,
                .init_hwif      = init_hwif_svwks,
-               .channels       = 1,    /* 2 */
                .autodma        = AUTODMA,
                .bootable       = ON_BOARD,
+               .host_flags     = IDE_HFLAG_SINGLE,
        }
 };
 
index d396b2929ed87791564600b85675d72eda7af774..ed983b56b4e2a4b5c12217250182c322df430f5f 100644 (file)
@@ -724,10 +724,10 @@ static ide_pci_device_t sgiioc4_chipset __devinitdata = {
         .name = "SGIIOC4",
         .init_hwif = ide_init_sgiioc4,
         .init_dma = ide_dma_sgiioc4,
-        .channels = 1,
         .autodma = AUTODMA,
         /* SGI IOC4 doesn't have enablebits. */
         .bootable = ON_BOARD,
+        .host_flags = IDE_HFLAG_SINGLE,
 };
 
 int
index 5304fc5c616a076025fb3284f088483155e70d3a..47b9b94afe05ce7c863858e516ee9cd66a95288e 100644 (file)
@@ -957,7 +957,6 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
                .init_iops      = init_iops_siimage,    \
                .init_hwif      = init_hwif_siimage,    \
                .fixup          = siimage_fixup,        \
-               .channels       = 2,                    \
                .autodma        = AUTODMA,              \
                .bootable       = ON_BOARD,             \
        }
index 756a9b6eb4624aa5688d3b2420a5dbde659a5977..bbc5020875784e151dfd65f3db365a7a4b07062c 100644 (file)
@@ -878,7 +878,6 @@ static ide_pci_device_t sis5513_chipset __devinitdata = {
        .name           = "SIS5513",
        .init_chipset   = init_chipset_sis5513,
        .init_hwif      = init_hwif_sis5513,
-       .channels       = 2,
        .autodma        = NOAUTODMA,
        .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
        .bootable       = ON_BOARD,
index f2156ee7e2bd0f7439d9086a5e492bf353e79252..f4637d29aaf50bd65a34581ba0b6d293efa2b139 100644 (file)
@@ -453,7 +453,6 @@ static ide_pci_device_t sl82c105_chipset __devinitdata = {
        .name           = "W82C105",
        .init_chipset   = init_chipset_sl82c105,
        .init_hwif      = init_hwif_sl82c105,
-       .channels       = 2,
        .autodma        = NOAUTODMA,
        .enablebits     = {{0x40,0x01,0x01}, {0x40,0x10,0x10}},
        .bootable       = ON_BOARD,
index 575dbbd8b482edb345960fc5e56ecbf87ed39693..115bcaefc8eec1f259dc6895573c1056c49cb63a 100644 (file)
@@ -214,7 +214,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
 static ide_pci_device_t slc90e66_chipset __devinitdata = {
        .name           = "SLC90E66",
        .init_hwif      = init_hwif_slc90e66,
-       .channels       = 2,
        .autodma        = AUTODMA,
        .enablebits     = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
        .bootable       = ON_BOARD,
index 8de1f8e224946b589fb173df6d572499598eecb2..1d40b0820f509922855ead0e7e9543c75c3b0c62 100644 (file)
@@ -248,9 +248,9 @@ static ide_pci_device_t tc86c001_chipset __devinitdata = {
        .name           = "TC86C001",
        .init_chipset   = init_chipset_tc86c001,
        .init_hwif      = init_hwif_tc86c001,
-       .channels       = 1,
        .autodma        = AUTODMA,
-       .bootable       = OFF_BOARD
+       .bootable       = OFF_BOARD,
+       .host_flags     = IDE_HFLAG_SINGLE,
 };
 
 static int __devinit tc86c001_init_one(struct pci_dev *dev,
index 35e8c612638f687509c42311c38d13973f92752c..801314fe3524e622da3cafb5576d10bb08f40745 100644 (file)
@@ -129,7 +129,6 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
 static ide_pci_device_t triflex_device __devinitdata = {
        .name           = "TRIFLEX",
        .init_hwif      = init_hwif_triflex,
-       .channels       = 2,
        .autodma        = AUTODMA,
        .enablebits     = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}},
        .bootable       = ON_BOARD,
index cbb1b11119a520b9b0c8db24d796fb7c931832f3..dc4f4e298e00d6591afda55930cf16e6968c51e8 100644 (file)
@@ -327,7 +327,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
 static ide_pci_device_t trm290_chipset __devinitdata = {
        .name           = "TRM290",
        .init_hwif      = init_hwif_trm290,
-       .channels       = 2,
        .autodma        = NOAUTODMA,
        .bootable       = ON_BOARD,
 };
index 27e92fb9f95e0c49cdd1a874e017a8dc021a4f6a..bfc9b67f8c9293f935784a5ef9cfe6b231033123 100644 (file)
@@ -498,7 +498,6 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
                .name           = "VP_IDE",
                .init_chipset   = init_chipset_via82cxxx,
                .init_hwif      = init_hwif_via82cxxx,
-               .channels       = 2,
                .autodma        = NOAUTODMA,
                .enablebits     = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
                .bootable       = ON_BOARD
@@ -506,7 +505,6 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
                .name           = "VP_IDE",
                .init_chipset   = init_chipset_via82cxxx,
                .init_hwif      = init_hwif_via82cxxx,
-               .channels       = 2,
                .autodma        = AUTODMA,
                .enablebits     = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
                .bootable       = ON_BOARD,
index c88d33225cf91542cc490c00d9e37d026bdf5895..bfe1f4e595975fb70ad8453130f4f08af9d255a9 100644 (file)
@@ -407,7 +407,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
        unsigned long ctl = 0, base = 0;
        ide_hwif_t *hwif;
 
-       if ((d->flags & IDEPCI_FLAG_ISA_PORTS) == 0) {
+       if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
                /*  Possibly we should fail if these checks report true */
                ide_pci_check_iomem(dev, d, 2*port);
                ide_pci_check_iomem(dev, d, 2*port+1);
@@ -571,7 +571,7 @@ out:
  
 void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, ata_index_t *index)
 {
-       int port;
+       int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port;
        int at_least_one_hwif_enabled = 0;
        ide_hwif_t *hwif, *mate = NULL;
        u8 tmp;
@@ -582,16 +582,13 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
         * Set up the IDE ports
         */
         
-       for (port = 0; port <= 1; ++port) {
+       for (port = 0; port < channels; ++port) {
                ide_pci_enablebit_t *e = &(d->enablebits[port]);
        
                if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
                    (tmp & e->mask) != e->val))
                        continue;       /* port not enabled */
 
-               if (d->channels <= port)
-                       break;
-       
                if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == NULL)
                        continue;
 
index 349c22a1fbc5d7fd7e25e05fe69a0fc871be3457..498dc57627fa98c46de3baebf7b013a5cfae1ad8 100644 (file)
@@ -1244,7 +1244,8 @@ typedef struct ide_pci_enablebit_s {
 
 enum {
        /* Uses ISA control ports not PCI ones. */
-       IDEPCI_FLAG_ISA_PORTS           = (1 << 0),
+       IDE_HFLAG_ISA_PORTS             = (1 << 0),
+       IDE_HFLAG_SINGLE                = (1 << 1),
 };
 
 typedef struct ide_pci_device_s {
@@ -1256,13 +1257,12 @@ typedef struct ide_pci_device_s {
        void                    (*init_hwif)(ide_hwif_t *);
        void                    (*init_dma)(ide_hwif_t *, unsigned long);
        void                    (*fixup)(ide_hwif_t *);
-       u8                      channels;
        u8                      autodma;
        ide_pci_enablebit_t     enablebits[2];
        u8                      bootable;
        unsigned int            extra;
        struct ide_pci_device_s *next;
-       u8                      flags;
+       u8                      host_flags;
        u8                      udma_mask;
 } ide_pci_device_t;