From a5d8c5c834d3cabf4b7b477c3f6ee923c25026fc Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 20 Jul 2007 01:11:55 +0200 Subject: [PATCH] ide: add ide_pci_device_t.host_flags (take 2) * 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 Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/pci/aec62xx.c | 5 ----- drivers/ide/pci/alim15x3.c | 1 - drivers/ide/pci/amd74xx.c | 2 -- drivers/ide/pci/atiixp.c | 3 +-- drivers/ide/pci/cmd64x.c | 4 ---- drivers/ide/pci/cs5520.c | 3 +-- drivers/ide/pci/cs5530.c | 1 - drivers/ide/pci/cs5535.c | 2 +- drivers/ide/pci/cy82c693.c | 2 +- drivers/ide/pci/generic.c | 15 --------------- drivers/ide/pci/hpt34x.c | 1 - drivers/ide/pci/hpt366.c | 8 +------- drivers/ide/pci/it8213.c | 2 +- drivers/ide/pci/it821x.c | 1 - drivers/ide/pci/jmicron.c | 1 - drivers/ide/pci/ns87415.c | 1 - drivers/ide/pci/opti621.c | 2 -- drivers/ide/pci/pdc202xx_new.c | 7 ------- drivers/ide/pci/pdc202xx_old.c | 5 ----- drivers/ide/pci/piix.c | 4 +--- drivers/ide/pci/rz1000.c | 1 - drivers/ide/pci/sc1200.c | 1 - drivers/ide/pci/scc_pata.c | 2 +- drivers/ide/pci/serverworks.c | 16 ++++++++-------- drivers/ide/pci/sgiioc4.c | 2 +- drivers/ide/pci/siimage.c | 1 - drivers/ide/pci/sis5513.c | 1 - drivers/ide/pci/sl82c105.c | 1 - drivers/ide/pci/slc90e66.c | 1 - drivers/ide/pci/tc86c001.c | 4 ++-- drivers/ide/pci/triflex.c | 1 - drivers/ide/pci/trm290.c | 1 - drivers/ide/pci/via82cxxx.c | 2 -- drivers/ide/setup-pci.c | 9 +++------ include/linux/ide.h | 6 +++--- 35 files changed, 25 insertions(+), 94 deletions(-) diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index 6d18fef558b..f8ac91c22e6 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c @@ -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, diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index ba0fb92b041..1012da6e8a4 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c @@ -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, }; diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 8d30b99a54d..9c3ea90aeb8 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c @@ -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, \ diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c index bfdf086f452..078adbe250d 100644 --- a/drivers/ide/pci/atiixp.c +++ b/drivers/ide/pci/atiixp.c @@ -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, }, }; diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 5171e94facd..8150a023dd7 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c @@ -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, diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index 3b88a3a5611..5539a25eae9 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -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 = { diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index b5c00d15a70..643d66cc672 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c @@ -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, }; diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c index 10f61f38243..50397937214 100644 --- a/drivers/ide/pci/cs5535.c +++ b/drivers/ide/pci/cs5535.c @@ -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, diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c index 103b9db9785..995b7256361 100644 --- a/drivers/ide/pci/cy82c693.c +++ b/drivers/ide/pci/cy82c693.c @@ -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) diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index 0d51a11e81d..48caa468b76 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c @@ -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, } diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index 64f19743b12..6d2ef0ee0f2 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c @@ -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 diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 81853d740ae..182346a04f3 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -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, diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index ff48c23e571..684b0ec79f4 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c @@ -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 = { diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c index 8197b653ba1..faccb2d4af4 100644 --- a/drivers/ide/pci/it821x.c +++ b/drivers/ide/pci/it821x.c @@ -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 \ diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index a6008f63e71..0edb9cd4585 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c @@ -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} }, \ diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index b310c4f5107..09941f37d63 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c @@ -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, }; diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c index aede7eee924..78d7adf2d0b 100644 --- a/drivers/ide/pci/opti621.c +++ b/drivers/ide/pci/opti621.c @@ -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, diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 06c5e93d37a..f8508d9cccd 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c @@ -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*/ diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 25cebfe18dd..eb4e4a61d06 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c @@ -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, diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 1372c35be03..a4f88d25b16 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -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 */ diff --git a/drivers/ide/pci/rz1000.c b/drivers/ide/pci/rz1000.c index f8c95469014..10e1ae7a4a0 100644 --- a/drivers/ide/pci/rz1000.c +++ b/drivers/ide/pci/rz1000.c @@ -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, }; diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c index 523363c9379..7dbc44cc722 100644 --- a/drivers/ide/pci/sc1200.c +++ b/drivers/ide/pci/sc1200.c @@ -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, }; diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index fd4b1a24eca..a1954d1c287 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c @@ -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 = { diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index ed04e0c8dd4..809deb92bc1 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c @@ -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, } }; diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index d396b2929ed..ed983b56b4e 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c @@ -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 diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 5304fc5c616..47b9b94afe0 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c @@ -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, \ } diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 756a9b6eb46..bbc50208757 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c @@ -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, diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index f2156ee7e2b..f4637d29aaf 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c @@ -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, diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 575dbbd8b48..115bcaefc8e 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c @@ -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, diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index 8de1f8e2249..1d40b0820f5 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c @@ -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, diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index 35e8c612638..801314fe352 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c @@ -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, diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c index cbb1b11119a..dc4f4e298e0 100644 --- a/drivers/ide/pci/trm290.c +++ b/drivers/ide/pci/trm290.c @@ -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, }; diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 27e92fb9f95..bfc9b67f8c9 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -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, diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index c88d33225cf..bfe1f4e5959 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c @@ -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; diff --git a/include/linux/ide.h b/include/linux/ide.h index 349c22a1fbc..498dc57627f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -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; -- 2.41.1