aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/ata_generic.c2
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/ata/libata-sff.c4
-rw-r--r--drivers/ata/pata_acpi.c18
-rw-r--r--drivers/ata/pata_ali.c2
-rw-r--r--drivers/ata/pata_amd.c27
-rw-r--r--drivers/ata/pata_artop.c2
-rw-r--r--drivers/ata/pata_atiixp.c2
-rw-r--r--drivers/ata/pata_cmd640.c2
-rw-r--r--drivers/ata/pata_cmd64x.c2
-rw-r--r--drivers/ata/pata_cs5530.c2
-rw-r--r--drivers/ata/pata_cs5535.c2
-rw-r--r--drivers/ata/pata_cs5536.c2
-rw-r--r--drivers/ata/pata_cypress.c2
-rw-r--r--drivers/ata/pata_efar.c2
-rw-r--r--drivers/ata/pata_hpt366.c12
-rw-r--r--drivers/ata/pata_hpt37x.c33
-rw-r--r--drivers/ata/pata_hpt3x2n.c9
-rw-r--r--drivers/ata/pata_it8213.c2
-rw-r--r--drivers/ata/pata_it821x.c2
-rw-r--r--drivers/ata/pata_jmicron.c18
-rw-r--r--drivers/ata/pata_marvell.c18
-rw-r--r--drivers/ata/pata_netcell.c2
-rw-r--r--drivers/ata/pata_ns87410.c2
-rw-r--r--drivers/ata/pata_ns87415.c2
-rw-r--r--drivers/ata/pata_oldpiix.c2
-rw-r--r--drivers/ata/pata_opti.c2
-rw-r--r--drivers/ata/pata_optidma.c2
-rw-r--r--drivers/ata/pata_pdc202xx_old.c2
-rw-r--r--drivers/ata/pata_radisys.c2
-rw-r--r--drivers/ata/pata_rz1000.c2
-rw-r--r--drivers/ata/pata_sc1200.c2
-rw-r--r--drivers/ata/pata_serverworks.c2
-rw-r--r--drivers/ata/pata_sil680.c2
-rw-r--r--drivers/ata/pata_sis.c8
-rw-r--r--drivers/ata/pata_sl82c105.c2
-rw-r--r--drivers/ata/pata_triflex.c2
-rw-r--r--drivers/ata/pata_via.c19
-rw-r--r--include/linux/libata.h2
39 files changed, 79 insertions, 145 deletions
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index a912ee01a47c..b23e2a1099c5 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -152,7 +152,7 @@ static int ata_generic_init_one(struct pci_dev *dev, const struct pci_device_id
152 if (dev->vendor == PCI_VENDOR_ID_AL) 152 if (dev->vendor == PCI_VENDOR_ID_AL)
153 ata_pci_clear_simplex(dev); 153 ata_pci_clear_simplex(dev);
154 154
155 return ata_pci_init_one(dev, ppi, &generic_sht); 155 return ata_pci_init_one(dev, ppi, &generic_sht, NULL);
156} 156}
157 157
158static struct pci_device_id ata_generic[] = { 158static struct pci_device_id ata_generic[] = {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index abbe3229480c..aa6bcd79d60a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6995,8 +6995,6 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev,
6995 6995
6996 if (!host->ops && (pi->port_ops != &ata_dummy_port_ops)) 6996 if (!host->ops && (pi->port_ops != &ata_dummy_port_ops))
6997 host->ops = pi->port_ops; 6997 host->ops = pi->port_ops;
6998 if (!host->private_data && pi->private_data)
6999 host->private_data = pi->private_data;
7000 } 6998 }
7001 6999
7002 return host; 7000 return host;
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index a9d5898cbbc4..6223ec042c80 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -827,6 +827,7 @@ int ata_pci_activate_sff_host(struct ata_host *host,
827 * @pdev: Controller to be initialized 827 * @pdev: Controller to be initialized
828 * @ppi: array of port_info, must be enough for two ports 828 * @ppi: array of port_info, must be enough for two ports
829 * @sht: scsi_host_template to use when registering the host 829 * @sht: scsi_host_template to use when registering the host
830 * @host_priv: host private_data
830 * 831 *
831 * This is a helper function which can be called from a driver's 832 * This is a helper function which can be called from a driver's
832 * xxx_init_one() probe function if the hardware uses traditional 833 * xxx_init_one() probe function if the hardware uses traditional
@@ -848,7 +849,7 @@ int ata_pci_activate_sff_host(struct ata_host *host,
848 */ 849 */
849int ata_pci_init_one(struct pci_dev *pdev, 850int ata_pci_init_one(struct pci_dev *pdev,
850 const struct ata_port_info * const * ppi, 851 const struct ata_port_info * const * ppi,
851 struct scsi_host_template *sht) 852 struct scsi_host_template *sht, void *host_priv)
852{ 853{
853 struct device *dev = &pdev->dev; 854 struct device *dev = &pdev->dev;
854 const struct ata_port_info *pi = NULL; 855 const struct ata_port_info *pi = NULL;
@@ -882,6 +883,7 @@ int ata_pci_init_one(struct pci_dev *pdev,
882 rc = ata_pci_prepare_sff_host(pdev, ppi, &host); 883 rc = ata_pci_prepare_sff_host(pdev, ppi, &host);
883 if (rc) 884 if (rc)
884 goto out; 885 goto out;
886 host->private_data = host_priv;
885 887
886 pci_set_master(pdev); 888 pci_set_master(pdev);
887 rc = ata_pci_activate_sff_host(host, ata_interrupt, sht); 889 rc = ata_pci_activate_sff_host(host, ata_interrupt, sht);
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index 3edde51750da..d337f3209caf 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -68,20 +68,6 @@ static int pacpi_cable_detect(struct ata_port *ap)
68} 68}
69 69
70/** 70/**
71 * pacpi_error_handler - Setup and error handler
72 * @ap: Port to handle
73 *
74 * LOCKING:
75 * None (inherited from caller).
76 */
77
78static void pacpi_error_handler(struct ata_port *ap)
79{
80 ata_bmdma_drive_eh(ap, pacpi_pre_reset, ata_std_softreset, NULL,
81 ata_std_postreset);
82}
83
84/**
85 * pacpi_discover_modes - filter non ACPI modes 71 * pacpi_discover_modes - filter non ACPI modes
86 * @adev: ATA device 72 * @adev: ATA device
87 * @mask: proposed modes 73 * @mask: proposed modes
@@ -242,7 +228,7 @@ static struct ata_port_operations pacpi_ops = {
242 .mode_filter = pacpi_mode_filter, 228 .mode_filter = pacpi_mode_filter,
243 .set_piomode = pacpi_set_piomode, 229 .set_piomode = pacpi_set_piomode,
244 .set_dmamode = pacpi_set_dmamode, 230 .set_dmamode = pacpi_set_dmamode,
245 .error_handler = pacpi_error_handler, 231 .prereset = pacpi_pre_reset,
246 .port_start = pacpi_port_start, 232 .port_start = pacpi_port_start,
247}; 233};
248 234
@@ -273,7 +259,7 @@ static int pacpi_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
273 .port_ops = &pacpi_ops, 259 .port_ops = &pacpi_ops,
274 }; 260 };
275 const struct ata_port_info *ppi[] = { &info, NULL }; 261 const struct ata_port_info *ppi[] = { &info, NULL };
276 return ata_pci_init_one(pdev, ppi, &pacpi_sht); 262 return ata_pci_init_one(pdev, ppi, &pacpi_sht, NULL);
277} 263}
278 264
279static const struct pci_device_id pacpi_pci_tbl[] = { 265static const struct pci_device_id pacpi_pci_tbl[] = {
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index f2924996f6e3..43c558f20f92 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -552,7 +552,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
552 ppi[0] = &info_20_udma; 552 ppi[0] = &info_20_udma;
553 pci_dev_put(isa_bridge); 553 pci_dev_put(isa_bridge);
554 } 554 }
555 return ata_pci_init_one(pdev, ppi, &ali_sht); 555 return ata_pci_init_one(pdev, ppi, &ali_sht, NULL);
556} 556}
557 557
558#ifdef CONFIG_PM 558#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 644702cac6ee..09c8286b6890 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -144,12 +144,6 @@ static int amd_pre_reset(struct ata_link *link, unsigned long deadline)
144 return ata_std_prereset(link, deadline); 144 return ata_std_prereset(link, deadline);
145} 145}
146 146
147static void amd_error_handler(struct ata_port *ap)
148{
149 ata_bmdma_drive_eh(ap, amd_pre_reset, ata_std_softreset, NULL,
150 ata_std_postreset);
151}
152
153static int amd_cable_detect(struct ata_port *ap) 147static int amd_cable_detect(struct ata_port *ap)
154{ 148{
155 static const u32 bitmask[2] = {0x03, 0x0C}; 149 static const u32 bitmask[2] = {0x03, 0x0C};
@@ -300,13 +294,6 @@ static int nv_pre_reset(struct ata_link *link, unsigned long deadline)
300 return ata_std_prereset(link, deadline); 294 return ata_std_prereset(link, deadline);
301} 295}
302 296
303static void nv_error_handler(struct ata_port *ap)
304{
305 ata_bmdma_drive_eh(ap, nv_pre_reset,
306 ata_std_softreset, NULL,
307 ata_std_postreset);
308}
309
310/** 297/**
311 * nv100_set_piomode - set initial PIO mode data 298 * nv100_set_piomode - set initial PIO mode data
312 * @ap: ATA interface 299 * @ap: ATA interface
@@ -358,7 +345,7 @@ static struct scsi_host_template amd_sht = {
358 345
359static const struct ata_port_operations amd_base_port_ops = { 346static const struct ata_port_operations amd_base_port_ops = {
360 .inherits = &ata_bmdma_port_ops, 347 .inherits = &ata_bmdma_port_ops,
361 .error_handler = amd_error_handler, 348 .prereset = amd_pre_reset,
362}; 349};
363 350
364static struct ata_port_operations amd33_port_ops = { 351static struct ata_port_operations amd33_port_ops = {
@@ -393,7 +380,7 @@ static const struct ata_port_operations nv_base_port_ops = {
393 .inherits = &ata_bmdma_port_ops, 380 .inherits = &ata_bmdma_port_ops,
394 .cable_detect = ata_cable_ignore, 381 .cable_detect = ata_cable_ignore,
395 .mode_filter = nv_mode_filter, 382 .mode_filter = nv_mode_filter,
396 .error_handler = nv_error_handler, 383 .prereset = nv_pre_reset,
397 .host_stop = nv_host_stop, 384 .host_stop = nv_host_stop,
398}; 385};
399 386
@@ -483,10 +470,10 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
483 .port_ops = &amd100_port_ops 470 .port_ops = &amd100_port_ops
484 } 471 }
485 }; 472 };
486 struct ata_port_info pi; 473 const struct ata_port_info *ppi[] = { NULL, NULL };
487 const struct ata_port_info *ppi[] = { &pi, NULL };
488 static int printed_version; 474 static int printed_version;
489 int type = id->driver_data; 475 int type = id->driver_data;
476 void *hpriv = NULL;
490 u8 fifo; 477 u8 fifo;
491 int rc; 478 int rc;
492 479
@@ -511,7 +498,7 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
511 /* 498 /*
512 * Okay, type is determined now. Apply type-specific workarounds. 499 * Okay, type is determined now. Apply type-specific workarounds.
513 */ 500 */
514 pi = info[type]; 501 ppi[0] = &info[type];
515 502
516 if (type < 3) 503 if (type < 3)
517 ata_pci_clear_simplex(pdev); 504 ata_pci_clear_simplex(pdev);
@@ -530,11 +517,11 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
530 u32 udma; 517 u32 udma;
531 518
532 pci_read_config_dword(pdev, 0x60, &udma); 519 pci_read_config_dword(pdev, 0x60, &udma);
533 pi.private_data = (void *)(unsigned long)udma; 520 hpriv = (void *)(unsigned long)udma;
534 } 521 }
535 522
536 /* And fire it up */ 523 /* And fire it up */
537 return ata_pci_init_one(pdev, ppi, &amd_sht); 524 return ata_pci_init_one(pdev, ppi, &amd_sht, hpriv);
538} 525}
539 526
540#ifdef CONFIG_PM 527#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 698a53c96111..ebd15cadf15f 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -430,7 +430,7 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
430 430
431 BUG_ON(ppi[0] == NULL); 431 BUG_ON(ppi[0] == NULL);
432 432
433 return ata_pci_init_one(pdev, ppi, &artop_sht); 433 return ata_pci_init_one(pdev, ppi, &artop_sht, NULL);
434} 434}
435 435
436static const struct pci_device_id artop_pci_tbl[] = { 436static const struct pci_device_id artop_pci_tbl[] = {
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 6fe433ba62bd..0bea7e75d2d6 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -248,7 +248,7 @@ static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
248 .port_ops = &atiixp_port_ops 248 .port_ops = &atiixp_port_ops
249 }; 249 };
250 const struct ata_port_info *ppi[] = { &info, NULL }; 250 const struct ata_port_info *ppi[] = { &info, NULL };
251 return ata_pci_init_one(dev, ppi, &atiixp_sht); 251 return ata_pci_init_one(dev, ppi, &atiixp_sht, NULL);
252} 252}
253 253
254static const struct pci_device_id atiixp[] = { 254static const struct pci_device_id atiixp[] = {
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c
index efd2bb5747b4..27219b00edf4 100644
--- a/drivers/ata/pata_cmd640.c
+++ b/drivers/ata/pata_cmd640.c
@@ -224,7 +224,7 @@ static int cmd640_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
224 224
225 cmd640_hardware_init(pdev); 225 cmd640_hardware_init(pdev);
226 226
227 return ata_pci_init_one(pdev, ppi, &cmd640_sht); 227 return ata_pci_init_one(pdev, ppi, &cmd640_sht, NULL);
228} 228}
229 229
230#ifdef CONFIG_PM 230#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index bfd72ef9cd31..f0e566623614 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -373,7 +373,7 @@ static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
373 pci_write_config_byte(pdev, UDIDETCR0, 0xF0); 373 pci_write_config_byte(pdev, UDIDETCR0, 0xF0);
374#endif 374#endif
375 375
376 return ata_pci_init_one(pdev, ppi, &cmd64x_sht); 376 return ata_pci_init_one(pdev, ppi, &cmd64x_sht, NULL);
377} 377}
378 378
379#ifdef CONFIG_PM 379#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index c632ce499d33..ac3ad55d7c3c 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -325,7 +325,7 @@ static int cs5530_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
325 ppi[1] = &info_palmax_secondary; 325 ppi[1] = &info_palmax_secondary;
326 326
327 /* Now kick off ATA set up */ 327 /* Now kick off ATA set up */
328 return ata_pci_init_one(pdev, ppi, &cs5530_sht); 328 return ata_pci_init_one(pdev, ppi, &cs5530_sht, NULL);
329} 329}
330 330
331#ifdef CONFIG_PM 331#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c
index d78cf95cbe45..5c0762ebf58c 100644
--- a/drivers/ata/pata_cs5535.c
+++ b/drivers/ata/pata_cs5535.c
@@ -199,7 +199,7 @@ static int cs5535_init_one(struct pci_dev *dev, const struct pci_device_id *id)
199 rdmsr(ATAC_CH0D1_PIO, timings, dummy); 199 rdmsr(ATAC_CH0D1_PIO, timings, dummy);
200 if (CS5535_BAD_PIO(timings)) 200 if (CS5535_BAD_PIO(timings))
201 wrmsr(ATAC_CH0D1_PIO, 0xF7F4F7F4UL, 0); 201 wrmsr(ATAC_CH0D1_PIO, 0xF7F4F7F4UL, 0);
202 return ata_pci_init_one(dev, ppi, &cs5535_sht); 202 return ata_pci_init_one(dev, ppi, &cs5535_sht, NULL);
203} 203}
204 204
205static const struct pci_device_id cs5535[] = { 205static const struct pci_device_id cs5535[] = {
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index f7c0e4e319ed..2d34b9145dcb 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -261,7 +261,7 @@ static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id)
261 return -ENODEV; 261 return -ENODEV;
262 } 262 }
263 263
264 return ata_pci_init_one(dev, ppi, &cs5536_sht); 264 return ata_pci_init_one(dev, ppi, &cs5536_sht, NULL);
265} 265}
266 266
267static const struct pci_device_id cs5536[] = { 267static const struct pci_device_id cs5536[] = {
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c
index cbd6670ea0de..ae14969e1dfe 100644
--- a/drivers/ata/pata_cypress.c
+++ b/drivers/ata/pata_cypress.c
@@ -136,7 +136,7 @@ static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *i
136 if (PCI_FUNC(pdev->devfn) != 1) 136 if (PCI_FUNC(pdev->devfn) != 1)
137 return -ENODEV; 137 return -ENODEV;
138 138
139 return ata_pci_init_one(pdev, ppi, &cy82c693_sht); 139 return ata_pci_init_one(pdev, ppi, &cy82c693_sht, NULL);
140} 140}
141 141
142static const struct pci_device_id cy82c693[] = { 142static const struct pci_device_id cy82c693[] = {
diff --git a/drivers/ata/pata_efar.c b/drivers/ata/pata_efar.c
index 0260edac2370..2f5b4848456a 100644
--- a/drivers/ata/pata_efar.c
+++ b/drivers/ata/pata_efar.c
@@ -275,7 +275,7 @@ static int efar_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
275 dev_printk(KERN_DEBUG, &pdev->dev, 275 dev_printk(KERN_DEBUG, &pdev->dev,
276 "version " DRV_VERSION "\n"); 276 "version " DRV_VERSION "\n");
277 277
278 return ata_pci_init_one(pdev, ppi, &efar_sht); 278 return ata_pci_init_one(pdev, ppi, &efar_sht, NULL);
279} 279}
280 280
281static const struct pci_device_id efar_pci_tbl[] = { 281static const struct pci_device_id efar_pci_tbl[] = {
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index b62d398ed84b..c2d4923d4db7 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -356,9 +356,9 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
356 .udma_mask = ATA_UDMA4, 356 .udma_mask = ATA_UDMA4,
357 .port_ops = &hpt366_port_ops 357 .port_ops = &hpt366_port_ops
358 }; 358 };
359 struct ata_port_info info = info_hpt366; 359 const struct ata_port_info *ppi[] = { &info_hpt366, NULL };
360 const struct ata_port_info *ppi[] = { &info, NULL };
361 360
361 void *hpriv = NULL;
362 u32 class_rev; 362 u32 class_rev;
363 u32 reg1; 363 u32 reg1;
364 int rc; 364 int rc;
@@ -383,17 +383,17 @@ static int hpt36x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
383 /* info_hpt366 is safe against re-entry so we can scribble on it */ 383 /* info_hpt366 is safe against re-entry so we can scribble on it */
384 switch((reg1 & 0x700) >> 8) { 384 switch((reg1 & 0x700) >> 8) {
385 case 5: 385 case 5:
386 info.private_data = &hpt366_40; 386 hpriv = &hpt366_40;
387 break; 387 break;
388 case 9: 388 case 9:
389 info.private_data = &hpt366_25; 389 hpriv = &hpt366_25;
390 break; 390 break;
391 default: 391 default:
392 info.private_data = &hpt366_33; 392 hpriv = &hpt366_33;
393 break; 393 break;
394 } 394 }
395 /* Now kick off ATA set up */ 395 /* Now kick off ATA set up */
396 return ata_pci_init_one(dev, ppi, &hpt36x_sht); 396 return ata_pci_init_one(dev, ppi, &hpt36x_sht, hpriv);
397} 397}
398 398
399#ifdef CONFIG_PM 399#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index a43c19753669..fb37e3a161fc 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -831,10 +831,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
831 }; 831 };
832 832
833 static const int MHz[4] = { 33, 40, 50, 66 }; 833 static const int MHz[4] = { 33, 40, 50, 66 };
834 const struct ata_port_info *port;
835 void *private_data = NULL; 834 void *private_data = NULL;
836 struct ata_port_info port_info; 835 const struct ata_port_info *ppi[] = { NULL, NULL };
837 const struct ata_port_info *ppi[] = { &port_info, NULL };
838 836
839 u8 irqmask; 837 u8 irqmask;
840 u32 class_rev; 838 u32 class_rev;
@@ -866,17 +864,17 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
866 864
867 switch(class_rev) { 865 switch(class_rev) {
868 case 3: 866 case 3:
869 port = &info_hpt370; 867 ppi[0] = &info_hpt370;
870 chip_table = &hpt370; 868 chip_table = &hpt370;
871 prefer_dpll = 0; 869 prefer_dpll = 0;
872 break; 870 break;
873 case 4: 871 case 4:
874 port = &info_hpt370a; 872 ppi[0] = &info_hpt370a;
875 chip_table = &hpt370a; 873 chip_table = &hpt370a;
876 prefer_dpll = 0; 874 prefer_dpll = 0;
877 break; 875 break;
878 case 5: 876 case 5:
879 port = &info_hpt372; 877 ppi[0] = &info_hpt372;
880 chip_table = &hpt372; 878 chip_table = &hpt372;
881 break; 879 break;
882 default: 880 default:
@@ -889,21 +887,21 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
889 /* 372N if rev >= 2*/ 887 /* 372N if rev >= 2*/
890 if (class_rev >= 2) 888 if (class_rev >= 2)
891 return -ENODEV; 889 return -ENODEV;
892 port = &info_hpt372; 890 ppi[0] = &info_hpt372;
893 chip_table = &hpt372a; 891 chip_table = &hpt372a;
894 break; 892 break;
895 case PCI_DEVICE_ID_TTI_HPT302: 893 case PCI_DEVICE_ID_TTI_HPT302:
896 /* 302N if rev > 1 */ 894 /* 302N if rev > 1 */
897 if (class_rev > 1) 895 if (class_rev > 1)
898 return -ENODEV; 896 return -ENODEV;
899 port = &info_hpt372; 897 ppi[0] = &info_hpt372;
900 /* Check this */ 898 /* Check this */
901 chip_table = &hpt302; 899 chip_table = &hpt302;
902 break; 900 break;
903 case PCI_DEVICE_ID_TTI_HPT371: 901 case PCI_DEVICE_ID_TTI_HPT371:
904 if (class_rev > 1) 902 if (class_rev > 1)
905 return -ENODEV; 903 return -ENODEV;
906 port = &info_hpt372; 904 ppi[0] = &info_hpt372;
907 chip_table = &hpt371; 905 chip_table = &hpt371;
908 /* Single channel device, master is not present 906 /* Single channel device, master is not present
909 but the BIOS (or us for non x86) must mark it 907 but the BIOS (or us for non x86) must mark it
@@ -914,7 +912,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
914 break; 912 break;
915 case PCI_DEVICE_ID_TTI_HPT374: 913 case PCI_DEVICE_ID_TTI_HPT374:
916 chip_table = &hpt374; 914 chip_table = &hpt374;
917 port = &info_hpt374; 915 ppi[0] = &info_hpt374;
918 break; 916 break;
919 default: 917 default:
920 printk(KERN_ERR "pata_hpt37x: PCI table is bogus please report (%d).\n", dev->device); 918 printk(KERN_ERR "pata_hpt37x: PCI table is bogus please report (%d).\n", dev->device);
@@ -993,7 +991,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
993 int dpll, adjust; 991 int dpll, adjust;
994 992
995 /* Compute DPLL */ 993 /* Compute DPLL */
996 dpll = (port->udma_mask & 0xC0) ? 3 : 2; 994 dpll = (ppi[0]->udma_mask & 0xC0) ? 3 : 2;
997 995
998 f_low = (MHz[clock_slot] * 48) / MHz[dpll]; 996 f_low = (MHz[clock_slot] * 48) / MHz[dpll];
999 f_high = f_low + 2; 997 f_high = f_low + 2;
@@ -1033,19 +1031,16 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1033 * about lack of UDMA133 support on lower clocks 1031 * about lack of UDMA133 support on lower clocks
1034 */ 1032 */
1035 1033
1036 if (clock_slot < 2 && port == &info_hpt370) 1034 if (clock_slot < 2 && ppi[0] == &info_hpt370)
1037 port = &info_hpt370_33; 1035 ppi[0] = &info_hpt370_33;
1038 if (clock_slot < 2 && port == &info_hpt370a) 1036 if (clock_slot < 2 && ppi[0] == &info_hpt370a)
1039 port = &info_hpt370a_33; 1037 ppi[0] = &info_hpt370a_33;
1040 printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n", 1038 printk(KERN_INFO "pata_hpt37x: %s using %dMHz bus clock.\n",
1041 chip_table->name, MHz[clock_slot]); 1039 chip_table->name, MHz[clock_slot]);
1042 } 1040 }
1043 1041
1044 /* Now kick off ATA set up */ 1042 /* Now kick off ATA set up */
1045 port_info = *port; 1043 return ata_pci_init_one(dev, ppi, &hpt37x_sht, private_data);
1046 port_info.private_data = private_data;
1047
1048 return ata_pci_init_one(dev, ppi, &hpt37x_sht);
1049} 1044}
1050 1045
1051static const struct pci_device_id hpt37x[] = { 1046static const struct pci_device_id hpt37x[] = {
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index 2c178c30116c..c774be93ae04 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -458,8 +458,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
458 .udma_mask = ATA_UDMA6, 458 .udma_mask = ATA_UDMA6,
459 .port_ops = &hpt3x2n_port_ops 459 .port_ops = &hpt3x2n_port_ops
460 }; 460 };
461 struct ata_port_info port = info; 461 const struct ata_port_info *ppi[] = { &info, NULL };
462 const struct ata_port_info *ppi[] = { &port, NULL };
463 462
464 u8 irqmask; 463 u8 irqmask;
465 u32 class_rev; 464 u32 class_rev;
@@ -468,6 +467,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
468 unsigned int f_low, f_high; 467 unsigned int f_low, f_high;
469 int adjust; 468 int adjust;
470 unsigned long iobase = pci_resource_start(dev, 4); 469 unsigned long iobase = pci_resource_start(dev, 4);
470 void *hpriv = NULL;
471 int rc; 471 int rc;
472 472
473 rc = pcim_enable_device(dev); 473 rc = pcim_enable_device(dev);
@@ -554,9 +554,8 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
554 pci_mhz); 554 pci_mhz);
555 /* Set our private data up. We only need a few flags so we use 555 /* Set our private data up. We only need a few flags so we use
556 it directly */ 556 it directly */
557 port.private_data = NULL;
558 if (pci_mhz > 60) { 557 if (pci_mhz > 60) {
559 port.private_data = (void *)PCI66; 558 hpriv = (void *)PCI66;
560 /* 559 /*
561 * On HPT371N, if ATA clock is 66 MHz we must set bit 2 in 560 * On HPT371N, if ATA clock is 66 MHz we must set bit 2 in
562 * the MISC. register to stretch the UltraDMA Tss timing. 561 * the MISC. register to stretch the UltraDMA Tss timing.
@@ -567,7 +566,7 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
567 } 566 }
568 567
569 /* Now kick off ATA set up */ 568 /* Now kick off ATA set up */
570 return ata_pci_init_one(dev, ppi, &hpt3x2n_sht); 569 return ata_pci_init_one(dev, ppi, &hpt3x2n_sht, hpriv);
571} 570}
572 571
573static const struct pci_device_id hpt3x2n[] = { 572static const struct pci_device_id hpt3x2n[] = {
diff --git a/drivers/ata/pata_it8213.c b/drivers/ata/pata_it8213.c
index 291a0d6e2434..d23a46b75028 100644
--- a/drivers/ata/pata_it8213.c
+++ b/drivers/ata/pata_it8213.c
@@ -287,7 +287,7 @@ static int it8213_init_one (struct pci_dev *pdev, const struct pci_device_id *en
287 dev_printk(KERN_DEBUG, &pdev->dev, 287 dev_printk(KERN_DEBUG, &pdev->dev,
288 "version " DRV_VERSION "\n"); 288 "version " DRV_VERSION "\n");
289 289
290 return ata_pci_init_one(pdev, ppi, &it8213_sht); 290 return ata_pci_init_one(pdev, ppi, &it8213_sht, NULL);
291} 291}
292 292
293static const struct pci_device_id it8213_pci_tbl[] = { 293static const struct pci_device_id it8213_pci_tbl[] = {
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 63c5cf0d1fee..6a8a4ddf5bfe 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -722,7 +722,7 @@ static int it821x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
722 else 722 else
723 ppi[0] = &info_smart; 723 ppi[0] = &info_smart;
724 724
725 return ata_pci_init_one(pdev, ppi, &it821x_sht); 725 return ata_pci_init_one(pdev, ppi, &it821x_sht, NULL);
726} 726}
727 727
728#ifdef CONFIG_PM 728#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index 859e47a600cc..317f3474e0ba 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -105,20 +105,6 @@ static int jmicron_pre_reset(struct ata_link *link, unsigned long deadline)
105 return ata_std_prereset(link, deadline); 105 return ata_std_prereset(link, deadline);
106} 106}
107 107
108/**
109 * jmicron_error_handler - Setup and error handler
110 * @ap: Port to handle
111 *
112 * LOCKING:
113 * None (inherited from caller).
114 */
115
116static void jmicron_error_handler(struct ata_port *ap)
117{
118 ata_bmdma_drive_eh(ap, jmicron_pre_reset, ata_std_softreset, NULL,
119 ata_std_postreset);
120}
121
122/* No PIO or DMA methods needed for this device */ 108/* No PIO or DMA methods needed for this device */
123 109
124static struct scsi_host_template jmicron_sht = { 110static struct scsi_host_template jmicron_sht = {
@@ -127,7 +113,7 @@ static struct scsi_host_template jmicron_sht = {
127 113
128static struct ata_port_operations jmicron_ops = { 114static struct ata_port_operations jmicron_ops = {
129 .inherits = &ata_bmdma_port_ops, 115 .inherits = &ata_bmdma_port_ops,
130 .error_handler = jmicron_error_handler, 116 .prereset = jmicron_pre_reset,
131}; 117};
132 118
133 119
@@ -158,7 +144,7 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
158 }; 144 };
159 const struct ata_port_info *ppi[] = { &info, NULL }; 145 const struct ata_port_info *ppi[] = { &info, NULL };
160 146
161 return ata_pci_init_one(pdev, ppi, &jmicron_sht); 147 return ata_pci_init_one(pdev, ppi, &jmicron_sht, NULL);
162} 148}
163 149
164static const struct pci_device_id jmicron_pci_tbl[] = { 150static const struct pci_device_id jmicron_pci_tbl[] = {
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index d8da4f344c0a..d38e64cd6097 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -75,20 +75,6 @@ static int marvell_cable_detect(struct ata_port *ap)
75 return 0; /* Our BUG macro needs the right markup */ 75 return 0; /* Our BUG macro needs the right markup */
76} 76}
77 77
78/**
79 * marvell_error_handler - Setup and error handler
80 * @ap: Port to handle
81 *
82 * LOCKING:
83 * None (inherited from caller).
84 */
85
86static void marvell_error_handler(struct ata_port *ap)
87{
88 ata_bmdma_drive_eh(ap, marvell_pre_reset, ata_std_softreset, NULL,
89 ata_std_postreset);
90}
91
92/* No PIO or DMA methods needed for this device */ 78/* No PIO or DMA methods needed for this device */
93 79
94static struct scsi_host_template marvell_sht = { 80static struct scsi_host_template marvell_sht = {
@@ -98,7 +84,7 @@ static struct scsi_host_template marvell_sht = {
98static struct ata_port_operations marvell_ops = { 84static struct ata_port_operations marvell_ops = {
99 .inherits = &ata_bmdma_port_ops, 85 .inherits = &ata_bmdma_port_ops,
100 .cable_detect = marvell_cable_detect, 86 .cable_detect = marvell_cable_detect,
101 .error_handler = marvell_error_handler, 87 .prereset = marvell_pre_reset,
102}; 88};
103 89
104 90
@@ -142,7 +128,7 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i
142 if (pdev->device == 0x6101) 128 if (pdev->device == 0x6101)
143 ppi[1] = &ata_dummy_port_info; 129 ppi[1] = &ata_dummy_port_info;
144 130
145 return ata_pci_init_one(pdev, ppi, &marvell_sht); 131 return ata_pci_init_one(pdev, ppi, &marvell_sht, NULL);
146} 132}
147 133
148static const struct pci_device_id marvell_pci_tbl[] = { 134static const struct pci_device_id marvell_pci_tbl[] = {
diff --git a/drivers/ata/pata_netcell.c b/drivers/ata/pata_netcell.c
index ae50a5e85cf1..349182840d24 100644
--- a/drivers/ata/pata_netcell.c
+++ b/drivers/ata/pata_netcell.c
@@ -71,7 +71,7 @@ static int netcell_init_one (struct pci_dev *pdev, const struct pci_device_id *e
71 ata_pci_clear_simplex(pdev); 71 ata_pci_clear_simplex(pdev);
72 72
73 /* And let the library code do the work */ 73 /* And let the library code do the work */
74 return ata_pci_init_one(pdev, port_info, &netcell_sht); 74 return ata_pci_init_one(pdev, port_info, &netcell_sht, NULL);
75} 75}
76 76
77static const struct pci_device_id netcell_pci_tbl[] = { 77static const struct pci_device_id netcell_pci_tbl[] = {
diff --git a/drivers/ata/pata_ns87410.c b/drivers/ata/pata_ns87410.c
index 1bdca8f1e767..5a043e426480 100644
--- a/drivers/ata/pata_ns87410.c
+++ b/drivers/ata/pata_ns87410.c
@@ -163,7 +163,7 @@ static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id)
163 .port_ops = &ns87410_port_ops 163 .port_ops = &ns87410_port_ops
164 }; 164 };
165 const struct ata_port_info *ppi[] = { &info, NULL }; 165 const struct ata_port_info *ppi[] = { &info, NULL };
166 return ata_pci_init_one(dev, ppi, &ns87410_sht); 166 return ata_pci_init_one(dev, ppi, &ns87410_sht, NULL);
167} 167}
168 168
169static const struct pci_device_id ns87410[] = { 169static const struct pci_device_id ns87410[] = {
diff --git a/drivers/ata/pata_ns87415.c b/drivers/ata/pata_ns87415.c
index 42508940e4a9..cdd79d6fc0ee 100644
--- a/drivers/ata/pata_ns87415.c
+++ b/drivers/ata/pata_ns87415.c
@@ -375,7 +375,7 @@ static int ns87415_init_one (struct pci_dev *pdev, const struct pci_device_id *e
375 pci_write_config_byte(pdev, 0x55, 0xEE); 375 pci_write_config_byte(pdev, 0x55, 0xEE);
376 /* Select PIO0 8bit clocking */ 376 /* Select PIO0 8bit clocking */
377 pci_write_config_byte(pdev, 0x54, 0xB7); 377 pci_write_config_byte(pdev, 0x54, 0xB7);
378 return ata_pci_init_one(pdev, ppi, &ns87415_sht); 378 return ata_pci_init_one(pdev, ppi, &ns87415_sht, NULL);
379} 379}
380 380
381static const struct pci_device_id ns87415_pci_tbl[] = { 381static const struct pci_device_id ns87415_pci_tbl[] = {
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c
index 9e3afadbd04a..7001b756819e 100644
--- a/drivers/ata/pata_oldpiix.c
+++ b/drivers/ata/pata_oldpiix.c
@@ -263,7 +263,7 @@ static int oldpiix_init_one (struct pci_dev *pdev, const struct pci_device_id *e
263 dev_printk(KERN_DEBUG, &pdev->dev, 263 dev_printk(KERN_DEBUG, &pdev->dev,
264 "version " DRV_VERSION "\n"); 264 "version " DRV_VERSION "\n");
265 265
266 return ata_pci_init_one(pdev, ppi, &oldpiix_sht); 266 return ata_pci_init_one(pdev, ppi, &oldpiix_sht, NULL);
267} 267}
268 268
269static const struct pci_device_id oldpiix_pci_tbl[] = { 269static const struct pci_device_id oldpiix_pci_tbl[] = {
diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c
index 8601d9c3cb39..5a5f20e03fc0 100644
--- a/drivers/ata/pata_opti.c
+++ b/drivers/ata/pata_opti.c
@@ -188,7 +188,7 @@ static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id)
188 if (!printed_version++) 188 if (!printed_version++)
189 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n"); 189 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
190 190
191 return ata_pci_init_one(dev, ppi, &opti_sht); 191 return ata_pci_init_one(dev, ppi, &opti_sht, NULL);
192} 192}
193 193
194static const struct pci_device_id opti[] = { 194static const struct pci_device_id opti[] = {
diff --git a/drivers/ata/pata_optidma.c b/drivers/ata/pata_optidma.c
index c376f9ef77c8..ba2819ff964b 100644
--- a/drivers/ata/pata_optidma.c
+++ b/drivers/ata/pata_optidma.c
@@ -445,7 +445,7 @@ static int optidma_init_one(struct pci_dev *dev, const struct pci_device_id *id)
445 if (optiplus_with_udma(dev)) 445 if (optiplus_with_udma(dev))
446 ppi[0] = &info_82c700_udma; 446 ppi[0] = &info_82c700_udma;
447 447
448 return ata_pci_init_one(dev, ppi, &optidma_sht); 448 return ata_pci_init_one(dev, ppi, &optidma_sht, NULL);
449} 449}
450 450
451static const struct pci_device_id optidma[] = { 451static const struct pci_device_id optidma[] = {
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 5545fbab6a7e..8214100e3ac1 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -324,7 +324,7 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id
324 return -ENODEV; 324 return -ENODEV;
325 } 325 }
326 } 326 }
327 return ata_pci_init_one(dev, ppi, &pdc202xx_sht); 327 return ata_pci_init_one(dev, ppi, &pdc202xx_sht, NULL);
328} 328}
329 329
330static const struct pci_device_id pdc202xx[] = { 330static const struct pci_device_id pdc202xx[] = {
diff --git a/drivers/ata/pata_radisys.c b/drivers/ata/pata_radisys.c
index 145d5ba92795..9ab84fc3798d 100644
--- a/drivers/ata/pata_radisys.c
+++ b/drivers/ata/pata_radisys.c
@@ -228,7 +228,7 @@ static int radisys_init_one (struct pci_dev *pdev, const struct pci_device_id *e
228 dev_printk(KERN_DEBUG, &pdev->dev, 228 dev_printk(KERN_DEBUG, &pdev->dev,
229 "version " DRV_VERSION "\n"); 229 "version " DRV_VERSION "\n");
230 230
231 return ata_pci_init_one(pdev, ppi, &radisys_sht); 231 return ata_pci_init_one(pdev, ppi, &radisys_sht, NULL);
232} 232}
233 233
234static const struct pci_device_id radisys_pci_tbl[] = { 234static const struct pci_device_id radisys_pci_tbl[] = {
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c
index 04be6aee4354..462b72a31280 100644
--- a/drivers/ata/pata_rz1000.c
+++ b/drivers/ata/pata_rz1000.c
@@ -99,7 +99,7 @@ static int rz1000_init_one (struct pci_dev *pdev, const struct pci_device_id *en
99 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); 99 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
100 100
101 if (rz1000_fifo_disable(pdev) == 0) 101 if (rz1000_fifo_disable(pdev) == 0)
102 return ata_pci_init_one(pdev, ppi, &rz1000_sht); 102 return ata_pci_init_one(pdev, ppi, &rz1000_sht, NULL);
103 103
104 printk(KERN_ERR DRV_NAME ": failed to disable read-ahead on chipset..\n"); 104 printk(KERN_ERR DRV_NAME ": failed to disable read-ahead on chipset..\n");
105 /* Not safe to use so skip */ 105 /* Not safe to use so skip */
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
index 38c7fb0bebe9..42efacf73c79 100644
--- a/drivers/ata/pata_sc1200.c
+++ b/drivers/ata/pata_sc1200.c
@@ -213,7 +213,7 @@ static int sc1200_init_one(struct pci_dev *dev, const struct pci_device_id *id)
213 /* Can't enable port 2 yet, see top comments */ 213 /* Can't enable port 2 yet, see top comments */
214 const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info }; 214 const struct ata_port_info *ppi[] = { &info, &ata_dummy_port_info };
215 215
216 return ata_pci_init_one(dev, ppi, &sc1200_sht); 216 return ata_pci_init_one(dev, ppi, &sc1200_sht, NULL);
217} 217}
218 218
219static const struct pci_device_id sc1200[] = { 219static const struct pci_device_id sc1200[] = {
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 515b5b70a555..2f4f9b0f89de 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -461,7 +461,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
461 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) 461 if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
462 ata_pci_clear_simplex(pdev); 462 ata_pci_clear_simplex(pdev);
463 463
464 return ata_pci_init_one(pdev, ppi, &serverworks_sht); 464 return ata_pci_init_one(pdev, ppi, &serverworks_sht, NULL);
465} 465}
466 466
467#ifdef CONFIG_PM 467#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 5313deeffa6d..63fafc6d6da3 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -362,7 +362,7 @@ static int __devinit sil680_init_one(struct pci_dev *pdev,
362 &sil680_sht); 362 &sil680_sht);
363 363
364use_ioports: 364use_ioports:
365 return ata_pci_init_one(pdev, ppi, &sil680_sht); 365 return ata_pci_init_one(pdev, ppi, &sil680_sht, NULL);
366} 366}
367 367
368#ifdef CONFIG_PM 368#ifdef CONFIG_PM
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 32be13ba5f06..28abfc26e7a4 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -690,8 +690,7 @@ static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis)
690static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) 690static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
691{ 691{
692 static int printed_version; 692 static int printed_version;
693 struct ata_port_info port; 693 const struct ata_port_info *ppi[] = { NULL, NULL };
694 const struct ata_port_info *ppi[] = { &port, NULL };
695 struct pci_dev *host = NULL; 694 struct pci_dev *host = NULL;
696 struct sis_chipset *chipset = NULL; 695 struct sis_chipset *chipset = NULL;
697 struct sis_chipset *sets; 696 struct sis_chipset *sets;
@@ -831,12 +830,11 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
831 if (chipset == NULL) 830 if (chipset == NULL)
832 return -ENODEV; 831 return -ENODEV;
833 832
834 port = *chipset->info; 833 ppi[0] = chipset->info;
835 port.private_data = chipset;
836 834
837 sis_fixup(pdev, chipset); 835 sis_fixup(pdev, chipset);
838 836
839 return ata_pci_init_one(pdev, ppi, &sis_sht); 837 return ata_pci_init_one(pdev, ppi, &sis_sht, chipset);
840} 838}
841 839
842static const struct pci_device_id sis_pci_tbl[] = { 840static const struct pci_device_id sis_pci_tbl[] = {
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c
index 2d14b2505c7d..1d97f920bd2b 100644
--- a/drivers/ata/pata_sl82c105.c
+++ b/drivers/ata/pata_sl82c105.c
@@ -323,7 +323,7 @@ static int sl82c105_init_one(struct pci_dev *dev, const struct pci_device_id *id
323 val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16; 323 val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16;
324 pci_write_config_dword(dev, 0x40, val); 324 pci_write_config_dword(dev, 0x40, val);
325 325
326 return ata_pci_init_one(dev, ppi, &sl82c105_sht); 326 return ata_pci_init_one(dev, ppi, &sl82c105_sht, NULL);
327} 327}
328 328
329static const struct pci_device_id sl82c105[] = { 329static const struct pci_device_id sl82c105[] = {
diff --git a/drivers/ata/pata_triflex.c b/drivers/ata/pata_triflex.c
index 86dc66c37389..f07b0e5df222 100644
--- a/drivers/ata/pata_triflex.c
+++ b/drivers/ata/pata_triflex.c
@@ -206,7 +206,7 @@ static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id)
206 if (!printed_version++) 206 if (!printed_version++)
207 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n"); 207 dev_printk(KERN_DEBUG, &dev->dev, "version " DRV_VERSION "\n");
208 208
209 return ata_pci_init_one(dev, ppi, &triflex_sht); 209 return ata_pci_init_one(dev, ppi, &triflex_sht, NULL);
210} 210}
211 211
212static const struct pci_device_id triflex[] = { 212static const struct pci_device_id triflex[] = {
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index e66bb85ad3d1..f4092cbd566f 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -442,8 +442,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
442 .udma_mask = ATA_UDMA6, /* FIXME: should check north bridge */ 442 .udma_mask = ATA_UDMA6, /* FIXME: should check north bridge */
443 .port_ops = &via_port_ops 443 .port_ops = &via_port_ops
444 }; 444 };
445 struct ata_port_info type; 445 const struct ata_port_info *ppi[] = { NULL, NULL };
446 const struct ata_port_info *ppi[] = { &type, NULL };
447 struct pci_dev *isa = NULL; 446 struct pci_dev *isa = NULL;
448 const struct via_isa_bridge *config; 447 const struct via_isa_bridge *config;
449 static int printed_version; 448 static int printed_version;
@@ -491,25 +490,25 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
491 switch(config->flags & VIA_UDMA) { 490 switch(config->flags & VIA_UDMA) {
492 case VIA_UDMA_NONE: 491 case VIA_UDMA_NONE:
493 if (config->flags & VIA_NO_UNMASK) 492 if (config->flags & VIA_NO_UNMASK)
494 type = via_mwdma_info_borked; 493 ppi[0] = &via_mwdma_info_borked;
495 else 494 else
496 type = via_mwdma_info; 495 ppi[0] = &via_mwdma_info;
497 break; 496 break;
498 case VIA_UDMA_33: 497 case VIA_UDMA_33:
499 type = via_udma33_info; 498 ppi[0] = &via_udma33_info;
500 break; 499 break;
501 case VIA_UDMA_66: 500 case VIA_UDMA_66:
502 type = via_udma66_info; 501 ppi[0] = &via_udma66_info;
503 /* The 66 MHz devices require we enable the clock */ 502 /* The 66 MHz devices require we enable the clock */
504 pci_read_config_dword(pdev, 0x50, &timing); 503 pci_read_config_dword(pdev, 0x50, &timing);
505 timing |= 0x80008; 504 timing |= 0x80008;
506 pci_write_config_dword(pdev, 0x50, timing); 505 pci_write_config_dword(pdev, 0x50, timing);
507 break; 506 break;
508 case VIA_UDMA_100: 507 case VIA_UDMA_100:
509 type = via_udma100_info; 508 ppi[0] = &via_udma100_info;
510 break; 509 break;
511 case VIA_UDMA_133: 510 case VIA_UDMA_133:
512 type = via_udma133_info; 511 ppi[0] = &via_udma133_info;
513 break; 512 break;
514 default: 513 default:
515 WARN_ON(1); 514 WARN_ON(1);
@@ -524,9 +523,7 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
524 } 523 }
525 524
526 /* We have established the device type, now fire it up */ 525 /* We have established the device type, now fire it up */
527 type.private_data = (void *)config; 526 return ata_pci_init_one(pdev, ppi, &via_sht, (void *)config);
528
529 return ata_pci_init_one(pdev, ppi, &via_sht);
530} 527}
531 528
532#ifdef CONFIG_PM 529#ifdef CONFIG_PM
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 5494119854de..e7f10a88efe1 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1020,7 +1020,7 @@ struct pci_dev;
1020 1020
1021extern int ata_pci_init_one(struct pci_dev *pdev, 1021extern int ata_pci_init_one(struct pci_dev *pdev,
1022 const struct ata_port_info * const * ppi, 1022 const struct ata_port_info * const * ppi,
1023 struct scsi_host_template *sht); 1023 struct scsi_host_template *sht, void *host_priv);
1024extern void ata_pci_remove_one(struct pci_dev *pdev); 1024extern void ata_pci_remove_one(struct pci_dev *pdev);
1025#ifdef CONFIG_PM 1025#ifdef CONFIG_PM
1026extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg); 1026extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);