aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-03-24 23:22:49 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-17 15:44:17 -0400
commit029cfd6b74fc5c517865fad78cf4a3ea8d9b664a (patch)
tree4a40f44f29321e433497a51d2f6cfe1922ae1d58 /drivers
parent68d1d07b510bb57a504588adc2bd2758adea0965 (diff)
libata: implement and use ops inheritance
libata lets low level drivers build ata_port_operations table and register it with libata core layer. This allows low level drivers high level of flexibility but also burdens them with lots of boilerplate entries. This becomes worse for drivers which support related similar controllers which differ slightly. They share most of the operations except for a few. However, the driver still needs to list all operations for each variant. This results in large number of duplicate entries, which is not only inefficient but also error-prone as it becomes very difficult to tell what the actual differences are. This duplicate boilerplates all over the low level drivers also make updating the core layer exteremely difficult and error-prone. When compounded with multi-branched development model, it ends up accumulating inconsistencies over time. Some of those inconsistencies cause immediate problems and fixed. Others just remain there dormant making maintenance increasingly difficult. To rectify the problem, this patch implements ata_port_operations inheritance. To allow LLDs to easily re-use their own ops tables overriding only specific methods, this patch implements poor man's class inheritance. An ops table has ->inherits field which can be set to any ops table as long as it doesn't create a loop. When the host is started, the inheritance chain is followed and any operation which isn't specified is taken from the nearest ancestor which has it specified. This operation is called finalization and done only once per an ops table and the LLD doesn't have to do anything special about it other than making the ops table non-const such that libata can update it. libata provides four base ops tables lower drivers can inherit from - base, sata, pmp, sff and bmdma. To avoid overriding these ops accidentaly, these ops are declared const and LLDs should always inherit these instead of using them directly. After finalization, all the ops table are identical before and after the patch except for setting .irq_handler to ata_interrupt in drivers which didn't use to. The .irq_handler doesn't have any actual effect and the field will soon be removed by later patch. * sata_sx4 is still using old style EH and currently doesn't take advantage of ops inheritance. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ahci.c94
-rw-r--r--drivers/ata/ata_generic.c31
-rw-r--r--drivers/ata/ata_piix.c149
-rw-r--r--drivers/ata/libata-core.c113
-rw-r--r--drivers/ata/pata_acpi.c35
-rw-r--r--drivers/ata/pata_ali.c122
-rw-r--r--drivers/ata/pata_amd.c191
-rw-r--r--drivers/ata/pata_artop.c61
-rw-r--r--drivers/ata/pata_at32.c23
-rw-r--r--drivers/ata/pata_atiixp.c32
-rw-r--r--drivers/ata/pata_bf54x.c4
-rw-r--r--drivers/ata/pata_cmd640.c33
-rw-r--r--drivers/ata/pata_cmd64x.c96
-rw-r--r--drivers/ata/pata_cs5520.c29
-rw-r--r--drivers/ata/pata_cs5530.c31
-rw-r--r--drivers/ata/pata_cs5535.c31
-rw-r--r--drivers/ata/pata_cs5536.c31
-rw-r--r--drivers/ata/pata_cypress.c31
-rw-r--r--drivers/ata/pata_efar.c30
-rw-r--r--drivers/ata/pata_hpt366.c32
-rw-r--r--drivers/ata/pata_hpt37x.c122
-rw-r--r--drivers/ata/pata_hpt3x2n.c32
-rw-r--r--drivers/ata/pata_hpt3x3.c33
-rw-r--r--drivers/ata/pata_icside.c32
-rw-r--r--drivers/ata/pata_isapnp.c21
-rw-r--r--drivers/ata/pata_it8213.c31
-rw-r--r--drivers/ata/pata_it821x.c57
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c23
-rw-r--r--drivers/ata/pata_jmicron.c31
-rw-r--r--drivers/ata/pata_legacy.c260
-rw-r--r--drivers/ata/pata_marvell.c33
-rw-r--r--drivers/ata/pata_mpc52xx.c18
-rw-r--r--drivers/ata/pata_mpiix.c23
-rw-r--r--drivers/ata/pata_netcell.c32
-rw-r--r--drivers/ata/pata_ninja32.c30
-rw-r--r--drivers/ata/pata_ns87410.c25
-rw-r--r--drivers/ata/pata_ns87415.c68
-rw-r--r--drivers/ata/pata_oldpiix.c31
-rw-r--r--drivers/ata/pata_opti.c23
-rw-r--r--drivers/ata/pata_optidma.c63
-rw-r--r--drivers/ata/pata_pcmcia.c48
-rw-r--r--drivers/ata/pata_pdc2027x.c56
-rw-r--r--drivers/ata/pata_pdc202xx_old.c75
-rw-r--r--drivers/ata/pata_platform.c24
-rw-r--r--drivers/ata/pata_qdi.c47
-rw-r--r--drivers/ata/pata_radisys.c32
-rw-r--r--drivers/ata/pata_rb500_cf.c16
-rw-r--r--drivers/ata/pata_rz1000.c25
-rw-r--r--drivers/ata/pata_sc1200.c33
-rw-r--r--drivers/ata/pata_scc.c7
-rw-r--r--drivers/ata/pata_serverworks.c63
-rw-r--r--drivers/ata/pata_sil680.c30
-rw-r--r--drivers/ata/pata_sis.c177
-rw-r--r--drivers/ata/pata_sl82c105.c34
-rw-r--r--drivers/ata/pata_triflex.c32
-rw-r--r--drivers/ata/pata_via.c61
-rw-r--r--drivers/ata/pata_winbond.c25
-rw-r--r--drivers/ata/pdc_adma.c19
-rw-r--r--drivers/ata/sata_fsl.c5
-rw-r--r--drivers/ata/sata_inic162x.c19
-rw-r--r--drivers/ata/sata_mv.c66
-rw-r--r--drivers/ata/sata_nv.c113
-rw-r--r--drivers/ata/sata_promise.c62
-rw-r--r--drivers/ata/sata_qstor.c20
-rw-r--r--drivers/ata/sata_sil.c21
-rw-r--r--drivers/ata/sata_sil24.c20
-rw-r--r--drivers/ata/sata_sis.c23
-rw-r--r--drivers/ata/sata_svw.c18
-rw-r--r--drivers/ata/sata_sx4.c3
-rw-r--r--drivers/ata/sata_uli.c28
-rw-r--r--drivers/ata/sata_via.c88
-rw-r--r--drivers/ata/sata_vsc.c19
72 files changed, 505 insertions, 2991 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 8862595cb2cf..dacb3ef0c3e6 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -280,118 +280,46 @@ static struct scsi_host_template ahci_sht = {
280 .shost_attrs = ahci_shost_attrs, 280 .shost_attrs = ahci_shost_attrs,
281}; 281};
282 282
283static const struct ata_port_operations ahci_ops = { 283static struct ata_port_operations ahci_ops = {
284 .inherits = &sata_pmp_port_ops,
285
284 .check_status = ahci_check_status, 286 .check_status = ahci_check_status,
285 .check_altstatus = ahci_check_status, 287 .check_altstatus = ahci_check_status,
286 .dev_select = ata_noop_dev_select,
287
288 .dev_config = ahci_dev_config,
289 288
290 .tf_read = ahci_tf_read, 289 .tf_read = ahci_tf_read,
291
292 .qc_defer = sata_pmp_qc_defer_cmd_switch, 290 .qc_defer = sata_pmp_qc_defer_cmd_switch,
293 .qc_prep = ahci_qc_prep, 291 .qc_prep = ahci_qc_prep,
294 .qc_issue = ahci_qc_issue, 292 .qc_issue = ahci_qc_issue,
295 293
296 .irq_clear = ata_noop_irq_clear,
297
298 .scr_read = ahci_scr_read,
299 .scr_write = ahci_scr_write,
300
301 .freeze = ahci_freeze, 294 .freeze = ahci_freeze,
302 .thaw = ahci_thaw, 295 .thaw = ahci_thaw,
303
304 .error_handler = ahci_error_handler, 296 .error_handler = ahci_error_handler,
305 .post_internal_cmd = ahci_post_internal_cmd, 297 .post_internal_cmd = ahci_post_internal_cmd,
306
307 .pmp_attach = ahci_pmp_attach,
308 .pmp_detach = ahci_pmp_detach,
309
310#ifdef CONFIG_PM
311 .port_suspend = ahci_port_suspend,
312 .port_resume = ahci_port_resume,
313#endif
314 .enable_pm = ahci_enable_alpm,
315 .disable_pm = ahci_disable_alpm,
316
317 .port_start = ahci_port_start,
318 .port_stop = ahci_port_stop,
319};
320
321static const struct ata_port_operations ahci_vt8251_ops = {
322 .check_status = ahci_check_status,
323 .check_altstatus = ahci_check_status,
324 .dev_select = ata_noop_dev_select,
325
326 .dev_config = ahci_dev_config, 298 .dev_config = ahci_dev_config,
327 299
328 .tf_read = ahci_tf_read,
329
330 .qc_defer = sata_pmp_qc_defer_cmd_switch,
331 .qc_prep = ahci_qc_prep,
332 .qc_issue = ahci_qc_issue,
333
334 .irq_clear = ata_noop_irq_clear,
335
336 .scr_read = ahci_scr_read, 300 .scr_read = ahci_scr_read,
337 .scr_write = ahci_scr_write, 301 .scr_write = ahci_scr_write,
338
339 .freeze = ahci_freeze,
340 .thaw = ahci_thaw,
341
342 .error_handler = ahci_vt8251_error_handler,
343 .post_internal_cmd = ahci_post_internal_cmd,
344
345 .pmp_attach = ahci_pmp_attach, 302 .pmp_attach = ahci_pmp_attach,
346 .pmp_detach = ahci_pmp_detach, 303 .pmp_detach = ahci_pmp_detach,
347 304
305 .enable_pm = ahci_enable_alpm,
306 .disable_pm = ahci_disable_alpm,
348#ifdef CONFIG_PM 307#ifdef CONFIG_PM
349 .port_suspend = ahci_port_suspend, 308 .port_suspend = ahci_port_suspend,
350 .port_resume = ahci_port_resume, 309 .port_resume = ahci_port_resume,
351#endif 310#endif
352 .enable_pm = ahci_enable_alpm,
353 .disable_pm = ahci_disable_alpm,
354
355 .port_start = ahci_port_start, 311 .port_start = ahci_port_start,
356 .port_stop = ahci_port_stop, 312 .port_stop = ahci_port_stop,
357}; 313};
358 314
359static const struct ata_port_operations ahci_p5wdh_ops = { 315static struct ata_port_operations ahci_vt8251_ops = {
360 .check_status = ahci_check_status, 316 .inherits = &ahci_ops,
361 .check_altstatus = ahci_check_status, 317 .error_handler = ahci_vt8251_error_handler,
362 .dev_select = ata_noop_dev_select, 318};
363
364 .dev_config = ahci_dev_config,
365
366 .tf_read = ahci_tf_read,
367
368 .qc_defer = sata_pmp_qc_defer_cmd_switch,
369 .qc_prep = ahci_qc_prep,
370 .qc_issue = ahci_qc_issue,
371
372 .irq_clear = ata_noop_irq_clear,
373
374 .scr_read = ahci_scr_read,
375 .scr_write = ahci_scr_write,
376
377 .freeze = ahci_freeze,
378 .thaw = ahci_thaw,
379 319
320static struct ata_port_operations ahci_p5wdh_ops = {
321 .inherits = &ahci_ops,
380 .error_handler = ahci_p5wdh_error_handler, 322 .error_handler = ahci_p5wdh_error_handler,
381 .post_internal_cmd = ahci_post_internal_cmd,
382
383 .pmp_attach = ahci_pmp_attach,
384 .pmp_detach = ahci_pmp_detach,
385
386#ifdef CONFIG_PM
387 .port_suspend = ahci_port_suspend,
388 .port_resume = ahci_port_resume,
389#endif
390 .enable_pm = ahci_enable_alpm,
391 .disable_pm = ahci_disable_alpm,
392
393 .port_start = ahci_port_start,
394 .port_stop = ahci_port_stop,
395}; 323};
396 324
397#define AHCI_HFLAGS(flags) .private_data = (void *)(flags) 325#define AHCI_HFLAGS(flags) .private_data = (void *)(flags)
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 5c64ce134c6c..0b5b515ae159 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -99,36 +99,9 @@ static struct scsi_host_template generic_sht = {
99}; 99};
100 100
101static struct ata_port_operations generic_port_ops = { 101static struct ata_port_operations generic_port_ops = {
102 .set_mode = generic_set_mode, 102 .inherits = &ata_bmdma_port_ops,
103 .mode_filter = ata_pci_default_filter,
104
105 .tf_load = ata_tf_load,
106 .tf_read = ata_tf_read,
107 .check_status = ata_check_status,
108 .exec_command = ata_exec_command,
109 .dev_select = ata_std_dev_select,
110
111 .bmdma_setup = ata_bmdma_setup,
112 .bmdma_start = ata_bmdma_start,
113 .bmdma_stop = ata_bmdma_stop,
114 .bmdma_status = ata_bmdma_status,
115
116 .data_xfer = ata_data_xfer,
117
118 .freeze = ata_bmdma_freeze,
119 .thaw = ata_bmdma_thaw,
120 .error_handler = ata_bmdma_error_handler,
121 .post_internal_cmd = ata_bmdma_post_internal_cmd,
122 .cable_detect = ata_cable_unknown, 103 .cable_detect = ata_cable_unknown,
123 104 .set_mode = generic_set_mode,
124 .qc_prep = ata_qc_prep,
125 .qc_issue = ata_qc_issue_prot,
126
127 .irq_handler = ata_interrupt,
128 .irq_clear = ata_bmdma_irq_clear,
129 .irq_on = ata_irq_on,
130
131 .port_start = ata_sff_port_start,
132}; 105};
133 106
134static int all_generic_ide; /* Set to claim all devices */ 107static int all_generic_ide; /* Set to claim all devices */
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 9f887b2c92df..bb46b61a7c6b 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -294,155 +294,34 @@ static struct scsi_host_template piix_sht = {
294 ATA_BMDMA_SHT(DRV_NAME), 294 ATA_BMDMA_SHT(DRV_NAME),
295}; 295};
296 296
297static const struct ata_port_operations piix_pata_ops = { 297static struct ata_port_operations piix_pata_ops = {
298 .inherits = &ata_bmdma_port_ops,
299 .cable_detect = ata_cable_40wire,
298 .set_piomode = piix_set_piomode, 300 .set_piomode = piix_set_piomode,
299 .set_dmamode = piix_set_dmamode, 301 .set_dmamode = piix_set_dmamode,
300 .mode_filter = ata_pci_default_filter,
301
302 .tf_load = ata_tf_load,
303 .tf_read = ata_tf_read,
304 .check_status = ata_check_status,
305 .exec_command = ata_exec_command,
306 .dev_select = ata_std_dev_select,
307
308 .bmdma_setup = ata_bmdma_setup,
309 .bmdma_start = ata_bmdma_start,
310 .bmdma_stop = ata_bmdma_stop,
311 .bmdma_status = ata_bmdma_status,
312 .qc_prep = ata_qc_prep,
313 .qc_issue = ata_qc_issue_prot,
314 .data_xfer = ata_data_xfer,
315
316 .freeze = ata_bmdma_freeze,
317 .thaw = ata_bmdma_thaw,
318 .error_handler = piix_pata_error_handler, 302 .error_handler = piix_pata_error_handler,
319 .post_internal_cmd = ata_bmdma_post_internal_cmd, 303};
320 .cable_detect = ata_cable_40wire,
321
322 .irq_clear = ata_bmdma_irq_clear,
323 .irq_on = ata_irq_on,
324 304
325 .port_start = ata_sff_port_start, 305static struct ata_port_operations piix_vmw_ops = {
306 .inherits = &piix_pata_ops,
307 .bmdma_status = piix_vmw_bmdma_status,
326}; 308};
327 309
328static const struct ata_port_operations ich_pata_ops = { 310static struct ata_port_operations ich_pata_ops = {
329 .set_piomode = piix_set_piomode, 311 .inherits = &piix_pata_ops,
330 .set_dmamode = ich_set_dmamode,
331 .mode_filter = ata_pci_default_filter,
332
333 .tf_load = ata_tf_load,
334 .tf_read = ata_tf_read,
335 .check_status = ata_check_status,
336 .exec_command = ata_exec_command,
337 .dev_select = ata_std_dev_select,
338
339 .bmdma_setup = ata_bmdma_setup,
340 .bmdma_start = ata_bmdma_start,
341 .bmdma_stop = ata_bmdma_stop,
342 .bmdma_status = ata_bmdma_status,
343 .qc_prep = ata_qc_prep,
344 .qc_issue = ata_qc_issue_prot,
345 .data_xfer = ata_data_xfer,
346
347 .freeze = ata_bmdma_freeze,
348 .thaw = ata_bmdma_thaw,
349 .error_handler = piix_pata_error_handler,
350 .post_internal_cmd = ata_bmdma_post_internal_cmd,
351 .cable_detect = ich_pata_cable_detect, 312 .cable_detect = ich_pata_cable_detect,
352 313 .set_dmamode = ich_set_dmamode,
353 .irq_clear = ata_bmdma_irq_clear,
354 .irq_on = ata_irq_on,
355
356 .port_start = ata_sff_port_start,
357}; 314};
358 315
359static const struct ata_port_operations piix_sata_ops = { 316static struct ata_port_operations piix_sata_ops = {
360 .tf_load = ata_tf_load, 317 .inherits = &ata_bmdma_port_ops,
361 .tf_read = ata_tf_read,
362 .check_status = ata_check_status,
363 .exec_command = ata_exec_command,
364 .dev_select = ata_std_dev_select,
365
366 .bmdma_setup = ata_bmdma_setup,
367 .bmdma_start = ata_bmdma_start,
368 .bmdma_stop = ata_bmdma_stop,
369 .bmdma_status = ata_bmdma_status,
370 .qc_prep = ata_qc_prep,
371 .qc_issue = ata_qc_issue_prot,
372 .data_xfer = ata_data_xfer,
373
374 .mode_filter = ata_pci_default_filter,
375 .freeze = ata_bmdma_freeze,
376 .thaw = ata_bmdma_thaw,
377 .error_handler = ata_bmdma_error_handler,
378 .post_internal_cmd = ata_bmdma_post_internal_cmd,
379
380 .irq_clear = ata_bmdma_irq_clear,
381 .irq_on = ata_irq_on,
382
383 .port_start = ata_sff_port_start,
384}; 318};
385 319
386static const struct ata_port_operations piix_vmw_ops = { 320static struct ata_port_operations piix_sidpr_sata_ops = {
387 .set_piomode = piix_set_piomode, 321 .inherits = &piix_sata_ops,
388 .set_dmamode = piix_set_dmamode,
389 .mode_filter = ata_pci_default_filter,
390
391 .tf_load = ata_tf_load,
392 .tf_read = ata_tf_read,
393 .check_status = ata_check_status,
394 .exec_command = ata_exec_command,
395 .dev_select = ata_std_dev_select,
396
397 .bmdma_setup = ata_bmdma_setup,
398 .bmdma_start = ata_bmdma_start,
399 .bmdma_stop = ata_bmdma_stop,
400 .bmdma_status = piix_vmw_bmdma_status,
401 .qc_prep = ata_qc_prep,
402 .qc_issue = ata_qc_issue_prot,
403 .data_xfer = ata_data_xfer,
404
405 .freeze = ata_bmdma_freeze,
406 .thaw = ata_bmdma_thaw,
407 .error_handler = piix_pata_error_handler,
408 .post_internal_cmd = ata_bmdma_post_internal_cmd,
409 .cable_detect = ata_cable_40wire,
410
411 .irq_handler = ata_interrupt,
412 .irq_clear = ata_bmdma_irq_clear,
413 .irq_on = ata_irq_on,
414
415 .port_start = ata_sff_port_start,
416};
417
418static const struct ata_port_operations piix_sidpr_sata_ops = {
419 .tf_load = ata_tf_load,
420 .tf_read = ata_tf_read,
421 .check_status = ata_check_status,
422 .exec_command = ata_exec_command,
423 .dev_select = ata_std_dev_select,
424
425 .bmdma_setup = ata_bmdma_setup,
426 .bmdma_start = ata_bmdma_start,
427 .bmdma_stop = ata_bmdma_stop,
428 .bmdma_status = ata_bmdma_status,
429 .qc_prep = ata_qc_prep,
430 .qc_issue = ata_qc_issue_prot,
431 .data_xfer = ata_data_xfer,
432
433 .scr_read = piix_sidpr_scr_read, 322 .scr_read = piix_sidpr_scr_read,
434 .scr_write = piix_sidpr_scr_write, 323 .scr_write = piix_sidpr_scr_write,
435
436 .mode_filter = ata_pci_default_filter,
437 .freeze = ata_bmdma_freeze,
438 .thaw = ata_bmdma_thaw,
439 .error_handler = piix_sidpr_error_handler, 324 .error_handler = piix_sidpr_error_handler,
440 .post_internal_cmd = ata_bmdma_post_internal_cmd,
441
442 .irq_clear = ata_bmdma_irq_clear,
443 .irq_on = ata_irq_on,
444
445 .port_start = ata_sff_port_start,
446}; 325};
447 326
448static const struct piix_map_db ich5_map_db = { 327static const struct piix_map_db ich5_map_db = {
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 394edf937cf2..32fa9ee397b6 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -74,6 +74,56 @@ const unsigned long sata_deb_timing_normal[] = { 5, 100, 2000 };
74const unsigned long sata_deb_timing_hotplug[] = { 25, 500, 2000 }; 74const unsigned long sata_deb_timing_hotplug[] = { 25, 500, 2000 };
75const unsigned long sata_deb_timing_long[] = { 100, 2000, 5000 }; 75const unsigned long sata_deb_timing_long[] = { 100, 2000, 5000 };
76 76
77const struct ata_port_operations ata_base_port_ops = {
78 .irq_clear = ata_noop_irq_clear,
79};
80
81const struct ata_port_operations sata_port_ops = {
82 .inherits = &ata_base_port_ops,
83
84 .qc_defer = ata_std_qc_defer,
85 .dev_select = ata_noop_dev_select,
86};
87
88const struct ata_port_operations sata_pmp_port_ops = {
89 .inherits = &sata_port_ops,
90};
91
92const struct ata_port_operations ata_sff_port_ops = {
93 .inherits = &ata_base_port_ops,
94
95 .qc_prep = ata_qc_prep,
96 .qc_issue = ata_qc_issue_prot,
97
98 .freeze = ata_bmdma_freeze,
99 .thaw = ata_bmdma_thaw,
100 .error_handler = ata_bmdma_error_handler,
101 .post_internal_cmd = ata_bmdma_post_internal_cmd,
102
103 .dev_select = ata_std_dev_select,
104 .check_status = ata_check_status,
105 .tf_load = ata_tf_load,
106 .tf_read = ata_tf_read,
107 .exec_command = ata_exec_command,
108 .data_xfer = ata_data_xfer,
109 .irq_on = ata_irq_on,
110
111 .port_start = ata_sff_port_start,
112 .irq_handler = ata_interrupt,
113};
114
115const struct ata_port_operations ata_bmdma_port_ops = {
116 .inherits = &ata_sff_port_ops,
117
118 .mode_filter = ata_pci_default_filter,
119
120 .bmdma_setup = ata_bmdma_setup,
121 .bmdma_start = ata_bmdma_start,
122 .bmdma_stop = ata_bmdma_stop,
123 .bmdma_status = ata_bmdma_status,
124 .irq_clear = ata_bmdma_irq_clear,
125};
126
77static unsigned int ata_dev_init_params(struct ata_device *dev, 127static unsigned int ata_dev_init_params(struct ata_device *dev,
78 u16 heads, u16 sectors); 128 u16 heads, u16 sectors);
79static unsigned int ata_dev_set_xfermode(struct ata_device *dev); 129static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
@@ -6972,6 +7022,56 @@ static void ata_host_stop(struct device *gendev, void *res)
6972} 7022}
6973 7023
6974/** 7024/**
7025 * ata_finalize_port_ops - finalize ata_port_operations
7026 * @ops: ata_port_operations to finalize
7027 *
7028 * An ata_port_operations can inherit from another ops and that
7029 * ops can again inherit from another. This can go on as many
7030 * times as necessary as long as there is no loop in the
7031 * inheritance chain.
7032 *
7033 * Ops tables are finalized when the host is started. NULL or
7034 * unspecified entries are inherited from the closet ancestor
7035 * which has the method and the entry is populated with it.
7036 * After finalization, the ops table directly points to all the
7037 * methods and ->inherits is no longer necessary and cleared.
7038 *
7039 * Using ATA_OP_NULL, inheriting ops can force a method to NULL.
7040 *
7041 * LOCKING:
7042 * None.
7043 */
7044static void ata_finalize_port_ops(struct ata_port_operations *ops)
7045{
7046 static spinlock_t lock = SPIN_LOCK_UNLOCKED;
7047 const struct ata_port_operations *cur;
7048 void **begin = (void **)ops;
7049 void **end = (void **)&ops->inherits;
7050 void **pp;
7051
7052 if (!ops || !ops->inherits)
7053 return;
7054
7055 spin_lock(&lock);
7056
7057 for (cur = ops->inherits; cur; cur = cur->inherits) {
7058 void **inherit = (void **)cur;
7059
7060 for (pp = begin; pp < end; pp++, inherit++)
7061 if (!*pp)
7062 *pp = *inherit;
7063 }
7064
7065 for (pp = begin; pp < end; pp++)
7066 if (IS_ERR(*pp))
7067 *pp = NULL;
7068
7069 ops->inherits = NULL;
7070
7071 spin_unlock(&lock);
7072}
7073
7074/**
6975 * ata_host_start - start and freeze ports of an ATA host 7075 * ata_host_start - start and freeze ports of an ATA host
6976 * @host: ATA host to start ports for 7076 * @host: ATA host to start ports for
6977 * 7077 *
@@ -6996,9 +7096,13 @@ int ata_host_start(struct ata_host *host)
6996 if (host->flags & ATA_HOST_STARTED) 7096 if (host->flags & ATA_HOST_STARTED)
6997 return 0; 7097 return 0;
6998 7098
7099 ata_finalize_port_ops(host->ops);
7100
6999 for (i = 0; i < host->n_ports; i++) { 7101 for (i = 0; i < host->n_ports; i++) {
7000 struct ata_port *ap = host->ports[i]; 7102 struct ata_port *ap = host->ports[i];
7001 7103
7104 ata_finalize_port_ops(ap->ops);
7105
7002 if (!host->ops && !ata_port_is_dummy(ap)) 7106 if (!host->ops && !ata_port_is_dummy(ap))
7003 host->ops = ap->ops; 7107 host->ops = ap->ops;
7004 7108
@@ -7060,7 +7164,7 @@ int ata_host_start(struct ata_host *host)
7060 */ 7164 */
7061/* KILLME - the only user left is ipr */ 7165/* KILLME - the only user left is ipr */
7062void ata_host_init(struct ata_host *host, struct device *dev, 7166void ata_host_init(struct ata_host *host, struct device *dev,
7063 unsigned long flags, const struct ata_port_operations *ops) 7167 unsigned long flags, struct ata_port_operations *ops)
7064{ 7168{
7065 spin_lock_init(&host->lock); 7169 spin_lock_init(&host->lock);
7066 host->dev = dev; 7170 host->dev = dev;
@@ -7749,7 +7853,7 @@ static unsigned int ata_dummy_qc_issue(struct ata_queued_cmd *qc)
7749 return AC_ERR_SYSTEM; 7853 return AC_ERR_SYSTEM;
7750} 7854}
7751 7855
7752const struct ata_port_operations ata_dummy_port_ops = { 7856struct ata_port_operations ata_dummy_port_ops = {
7753 .check_status = ata_dummy_check_status, 7857 .check_status = ata_dummy_check_status,
7754 .check_altstatus = ata_dummy_check_status, 7858 .check_altstatus = ata_dummy_check_status,
7755 .dev_select = ata_noop_dev_select, 7859 .dev_select = ata_noop_dev_select,
@@ -7777,6 +7881,11 @@ const struct ata_port_info ata_dummy_port_info = {
7777EXPORT_SYMBOL_GPL(sata_deb_timing_normal); 7881EXPORT_SYMBOL_GPL(sata_deb_timing_normal);
7778EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug); 7882EXPORT_SYMBOL_GPL(sata_deb_timing_hotplug);
7779EXPORT_SYMBOL_GPL(sata_deb_timing_long); 7883EXPORT_SYMBOL_GPL(sata_deb_timing_long);
7884EXPORT_SYMBOL_GPL(ata_base_port_ops);
7885EXPORT_SYMBOL_GPL(sata_port_ops);
7886EXPORT_SYMBOL_GPL(sata_pmp_port_ops);
7887EXPORT_SYMBOL_GPL(ata_sff_port_ops);
7888EXPORT_SYMBOL_GPL(ata_bmdma_port_ops);
7780EXPORT_SYMBOL_GPL(ata_dummy_port_ops); 7889EXPORT_SYMBOL_GPL(ata_dummy_port_ops);
7781EXPORT_SYMBOL_GPL(ata_dummy_port_info); 7890EXPORT_SYMBOL_GPL(ata_dummy_port_info);
7782EXPORT_SYMBOL_GPL(ata_std_bios_param); 7891EXPORT_SYMBOL_GPL(ata_std_bios_param);
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index 187545c0898a..35ad488db6ed 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -235,39 +235,14 @@ static struct scsi_host_template pacpi_sht = {
235 ATA_BMDMA_SHT(DRV_NAME), 235 ATA_BMDMA_SHT(DRV_NAME),
236}; 236};
237 237
238static const struct ata_port_operations pacpi_ops = { 238static struct ata_port_operations pacpi_ops = {
239 .inherits = &ata_bmdma_port_ops,
240 .qc_issue = pacpi_qc_issue_prot,
241 .cable_detect = pacpi_cable_detect,
242 .mode_filter = pacpi_mode_filter,
239 .set_piomode = pacpi_set_piomode, 243 .set_piomode = pacpi_set_piomode,
240 .set_dmamode = pacpi_set_dmamode, 244 .set_dmamode = pacpi_set_dmamode,
241 .mode_filter = pacpi_mode_filter,
242
243 /* Task file is PCI ATA format, use helpers */
244 .tf_load = ata_tf_load,
245 .tf_read = ata_tf_read,
246 .check_status = ata_check_status,
247 .exec_command = ata_exec_command,
248 .dev_select = ata_std_dev_select,
249
250 .freeze = ata_bmdma_freeze,
251 .thaw = ata_bmdma_thaw,
252 .error_handler = pacpi_error_handler, 245 .error_handler = pacpi_error_handler,
253 .post_internal_cmd = ata_bmdma_post_internal_cmd,
254 .cable_detect = pacpi_cable_detect,
255
256 /* BMDMA handling is PCI ATA format, use helpers */
257 .bmdma_setup = ata_bmdma_setup,
258 .bmdma_start = ata_bmdma_start,
259 .bmdma_stop = ata_bmdma_stop,
260 .bmdma_status = ata_bmdma_status,
261 .qc_prep = ata_qc_prep,
262 .qc_issue = pacpi_qc_issue_prot,
263 .data_xfer = ata_data_xfer,
264
265 /* Timeout handling */
266 .irq_handler = ata_interrupt,
267 .irq_clear = ata_bmdma_irq_clear,
268 .irq_on = ata_irq_on,
269
270 /* Generic PATA PCI ATA helpers */
271 .port_start = pacpi_port_start, 246 .port_start = pacpi_port_start,
272}; 247};
273 248
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index f3d6d9b345ba..b00a9cf72c31 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -347,29 +347,15 @@ static struct scsi_host_template ali_sht = {
347 */ 347 */
348 348
349static struct ata_port_operations ali_early_port_ops = { 349static struct ata_port_operations ali_early_port_ops = {
350 .set_piomode = ali_set_piomode, 350 .inherits = &ata_sff_port_ops,
351 .tf_load = ata_tf_load,
352 .tf_read = ata_tf_read,
353 .check_status = ata_check_status,
354 .exec_command = ata_exec_command,
355 .dev_select = ata_std_dev_select,
356
357 .freeze = ata_bmdma_freeze,
358 .thaw = ata_bmdma_thaw,
359 .error_handler = ata_bmdma_error_handler,
360 .post_internal_cmd = ata_bmdma_post_internal_cmd,
361 .cable_detect = ata_cable_40wire, 351 .cable_detect = ata_cable_40wire,
352 .set_piomode = ali_set_piomode,
353};
362 354
363 .qc_prep = ata_qc_prep, 355static const struct ata_port_operations ali_dma_base_ops = {
364 .qc_issue = ata_qc_issue_prot, 356 .inherits = &ata_bmdma_port_ops,
365 357 .set_piomode = ali_set_piomode,
366 .data_xfer = ata_data_xfer, 358 .set_dmamode = ali_set_dmamode,
367
368 .irq_handler = ata_interrupt,
369 .irq_clear = ata_noop_irq_clear,
370 .irq_on = ata_irq_on,
371
372 .port_start = ata_sff_port_start,
373}; 359};
374 360
375/* 361/*
@@ -377,115 +363,31 @@ static struct ata_port_operations ali_early_port_ops = {
377 * detect 363 * detect
378 */ 364 */
379static struct ata_port_operations ali_20_port_ops = { 365static struct ata_port_operations ali_20_port_ops = {
380 .set_piomode = ali_set_piomode, 366 .inherits = &ali_dma_base_ops,
381 .set_dmamode = ali_set_dmamode, 367 .cable_detect = ata_cable_40wire,
382 .mode_filter = ali_20_filter, 368 .mode_filter = ali_20_filter,
383
384 .tf_load = ata_tf_load,
385 .tf_read = ata_tf_read,
386 .check_atapi_dma = ali_check_atapi_dma, 369 .check_atapi_dma = ali_check_atapi_dma,
387 .check_status = ata_check_status,
388 .exec_command = ata_exec_command,
389 .dev_select = ata_std_dev_select,
390 .dev_config = ali_lock_sectors, 370 .dev_config = ali_lock_sectors,
391
392 .freeze = ata_bmdma_freeze,
393 .thaw = ata_bmdma_thaw,
394 .error_handler = ata_bmdma_error_handler,
395 .post_internal_cmd = ata_bmdma_post_internal_cmd,
396 .cable_detect = ata_cable_40wire,
397
398 .bmdma_setup = ata_bmdma_setup,
399 .bmdma_start = ata_bmdma_start,
400 .bmdma_stop = ata_bmdma_stop,
401 .bmdma_status = ata_bmdma_status,
402
403 .qc_prep = ata_qc_prep,
404 .qc_issue = ata_qc_issue_prot,
405
406 .data_xfer = ata_data_xfer,
407
408 .irq_handler = ata_interrupt,
409 .irq_clear = ata_bmdma_irq_clear,
410 .irq_on = ata_irq_on,
411
412 .port_start = ata_sff_port_start,
413}; 371};
414 372
415/* 373/*
416 * Port operations for DMA capable ALi with cable detect 374 * Port operations for DMA capable ALi with cable detect
417 */ 375 */
418static struct ata_port_operations ali_c2_port_ops = { 376static struct ata_port_operations ali_c2_port_ops = {
419 .set_piomode = ali_set_piomode, 377 .inherits = &ali_dma_base_ops,
420 .set_dmamode = ali_set_dmamode,
421 .mode_filter = ata_pci_default_filter,
422 .tf_load = ata_tf_load,
423 .tf_read = ata_tf_read,
424 .check_atapi_dma = ali_check_atapi_dma, 378 .check_atapi_dma = ali_check_atapi_dma,
425 .check_status = ata_check_status,
426 .exec_command = ata_exec_command,
427 .dev_select = ata_std_dev_select,
428 .dev_config = ali_lock_sectors,
429
430 .freeze = ata_bmdma_freeze,
431 .thaw = ata_bmdma_thaw,
432 .error_handler = ata_bmdma_error_handler,
433 .post_internal_cmd = ata_bmdma_post_internal_cmd,
434 .cable_detect = ali_c2_cable_detect, 379 .cable_detect = ali_c2_cable_detect,
435 380 .dev_config = ali_lock_sectors,
436 .bmdma_setup = ata_bmdma_setup,
437 .bmdma_start = ata_bmdma_start,
438 .bmdma_stop = ata_bmdma_stop,
439 .bmdma_status = ata_bmdma_status,
440
441 .qc_prep = ata_qc_prep,
442 .qc_issue = ata_qc_issue_prot,
443
444 .data_xfer = ata_data_xfer,
445
446 .irq_handler = ata_interrupt,
447 .irq_clear = ata_bmdma_irq_clear,
448 .irq_on = ata_irq_on,
449
450 .port_start = ata_sff_port_start,
451}; 381};
452 382
453/* 383/*
454 * Port operations for DMA capable ALi with cable detect and LBA48 384 * Port operations for DMA capable ALi with cable detect and LBA48
455 */ 385 */
456static struct ata_port_operations ali_c5_port_ops = { 386static struct ata_port_operations ali_c5_port_ops = {
457 .set_piomode = ali_set_piomode, 387 .inherits = &ali_dma_base_ops,
458 .set_dmamode = ali_set_dmamode,
459 .mode_filter = ata_pci_default_filter,
460 .tf_load = ata_tf_load,
461 .tf_read = ata_tf_read,
462 .check_atapi_dma = ali_check_atapi_dma, 388 .check_atapi_dma = ali_check_atapi_dma,
463 .check_status = ata_check_status,
464 .exec_command = ata_exec_command,
465 .dev_select = ata_std_dev_select,
466 .dev_config = ali_warn_atapi_dma, 389 .dev_config = ali_warn_atapi_dma,
467
468 .freeze = ata_bmdma_freeze,
469 .thaw = ata_bmdma_thaw,
470 .error_handler = ata_bmdma_error_handler,
471 .post_internal_cmd = ata_bmdma_post_internal_cmd,
472 .cable_detect = ali_c2_cable_detect, 390 .cable_detect = ali_c2_cable_detect,
473
474 .bmdma_setup = ata_bmdma_setup,
475 .bmdma_start = ata_bmdma_start,
476 .bmdma_stop = ata_bmdma_stop,
477 .bmdma_status = ata_bmdma_status,
478
479 .qc_prep = ata_qc_prep,
480 .qc_issue = ata_qc_issue_prot,
481
482 .data_xfer = ata_data_xfer,
483
484 .irq_handler = ata_interrupt,
485 .irq_clear = ata_bmdma_irq_clear,
486 .irq_on = ata_irq_on,
487
488 .port_start = ata_sff_port_start,
489}; 391};
490 392
491 393
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 90d786dfbec3..b0cb4eaf273c 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -356,204 +356,57 @@ static struct scsi_host_template amd_sht = {
356 ATA_BMDMA_SHT(DRV_NAME), 356 ATA_BMDMA_SHT(DRV_NAME),
357}; 357};
358 358
359static const struct ata_port_operations amd_base_port_ops = {
360 .inherits = &ata_bmdma_port_ops,
361 .error_handler = amd_error_handler,
362};
363
359static struct ata_port_operations amd33_port_ops = { 364static struct ata_port_operations amd33_port_ops = {
365 .inherits = &amd_base_port_ops,
366 .cable_detect = ata_cable_40wire,
360 .set_piomode = amd33_set_piomode, 367 .set_piomode = amd33_set_piomode,
361 .set_dmamode = amd33_set_dmamode, 368 .set_dmamode = amd33_set_dmamode,
362 .mode_filter = ata_pci_default_filter,
363 .tf_load = ata_tf_load,
364 .tf_read = ata_tf_read,
365 .check_status = ata_check_status,
366 .exec_command = ata_exec_command,
367 .dev_select = ata_std_dev_select,
368
369 .freeze = ata_bmdma_freeze,
370 .thaw = ata_bmdma_thaw,
371 .error_handler = amd_error_handler,
372 .post_internal_cmd = ata_bmdma_post_internal_cmd,
373 .cable_detect = ata_cable_40wire,
374
375 .bmdma_setup = ata_bmdma_setup,
376 .bmdma_start = ata_bmdma_start,
377 .bmdma_stop = ata_bmdma_stop,
378 .bmdma_status = ata_bmdma_status,
379
380 .qc_prep = ata_qc_prep,
381 .qc_issue = ata_qc_issue_prot,
382
383 .data_xfer = ata_data_xfer,
384
385 .irq_handler = ata_interrupt,
386 .irq_clear = ata_bmdma_irq_clear,
387 .irq_on = ata_irq_on,
388
389 .port_start = ata_sff_port_start,
390}; 369};
391 370
392static struct ata_port_operations amd66_port_ops = { 371static struct ata_port_operations amd66_port_ops = {
372 .inherits = &amd_base_port_ops,
373 .cable_detect = ata_cable_unknown,
393 .set_piomode = amd66_set_piomode, 374 .set_piomode = amd66_set_piomode,
394 .set_dmamode = amd66_set_dmamode, 375 .set_dmamode = amd66_set_dmamode,
395 .mode_filter = ata_pci_default_filter,
396 .tf_load = ata_tf_load,
397 .tf_read = ata_tf_read,
398 .check_status = ata_check_status,
399 .exec_command = ata_exec_command,
400 .dev_select = ata_std_dev_select,
401
402 .freeze = ata_bmdma_freeze,
403 .thaw = ata_bmdma_thaw,
404 .error_handler = amd_error_handler,
405 .post_internal_cmd = ata_bmdma_post_internal_cmd,
406 .cable_detect = ata_cable_unknown,
407
408 .bmdma_setup = ata_bmdma_setup,
409 .bmdma_start = ata_bmdma_start,
410 .bmdma_stop = ata_bmdma_stop,
411 .bmdma_status = ata_bmdma_status,
412
413 .qc_prep = ata_qc_prep,
414 .qc_issue = ata_qc_issue_prot,
415
416 .data_xfer = ata_data_xfer,
417
418 .irq_handler = ata_interrupt,
419 .irq_clear = ata_bmdma_irq_clear,
420 .irq_on = ata_irq_on,
421
422 .port_start = ata_sff_port_start,
423}; 376};
424 377
425static struct ata_port_operations amd100_port_ops = { 378static struct ata_port_operations amd100_port_ops = {
379 .inherits = &amd_base_port_ops,
380 .cable_detect = ata_cable_unknown,
426 .set_piomode = amd100_set_piomode, 381 .set_piomode = amd100_set_piomode,
427 .set_dmamode = amd100_set_dmamode, 382 .set_dmamode = amd100_set_dmamode,
428 .mode_filter = ata_pci_default_filter,
429 .tf_load = ata_tf_load,
430 .tf_read = ata_tf_read,
431 .check_status = ata_check_status,
432 .exec_command = ata_exec_command,
433 .dev_select = ata_std_dev_select,
434
435 .freeze = ata_bmdma_freeze,
436 .thaw = ata_bmdma_thaw,
437 .error_handler = amd_error_handler,
438 .post_internal_cmd = ata_bmdma_post_internal_cmd,
439 .cable_detect = ata_cable_unknown,
440
441 .bmdma_setup = ata_bmdma_setup,
442 .bmdma_start = ata_bmdma_start,
443 .bmdma_stop = ata_bmdma_stop,
444 .bmdma_status = ata_bmdma_status,
445
446 .qc_prep = ata_qc_prep,
447 .qc_issue = ata_qc_issue_prot,
448
449 .data_xfer = ata_data_xfer,
450
451 .irq_handler = ata_interrupt,
452 .irq_clear = ata_bmdma_irq_clear,
453 .irq_on = ata_irq_on,
454
455 .port_start = ata_sff_port_start,
456}; 383};
457 384
458static struct ata_port_operations amd133_port_ops = { 385static struct ata_port_operations amd133_port_ops = {
386 .inherits = &amd_base_port_ops,
387 .cable_detect = amd_cable_detect,
459 .set_piomode = amd133_set_piomode, 388 .set_piomode = amd133_set_piomode,
460 .set_dmamode = amd133_set_dmamode, 389 .set_dmamode = amd133_set_dmamode,
461 .mode_filter = ata_pci_default_filter, 390};
462 .tf_load = ata_tf_load,
463 .tf_read = ata_tf_read,
464 .check_status = ata_check_status,
465 .exec_command = ata_exec_command,
466 .dev_select = ata_std_dev_select,
467
468 .freeze = ata_bmdma_freeze,
469 .thaw = ata_bmdma_thaw,
470 .error_handler = amd_error_handler,
471 .post_internal_cmd = ata_bmdma_post_internal_cmd,
472 .cable_detect = amd_cable_detect,
473
474 .bmdma_setup = ata_bmdma_setup,
475 .bmdma_start = ata_bmdma_start,
476 .bmdma_stop = ata_bmdma_stop,
477 .bmdma_status = ata_bmdma_status,
478
479 .qc_prep = ata_qc_prep,
480 .qc_issue = ata_qc_issue_prot,
481
482 .data_xfer = ata_data_xfer,
483
484 .irq_handler = ata_interrupt,
485 .irq_clear = ata_bmdma_irq_clear,
486 .irq_on = ata_irq_on,
487 391
488 .port_start = ata_sff_port_start, 392static const struct ata_port_operations nv_base_port_ops = {
393 .inherits = &ata_bmdma_port_ops,
394 .cable_detect = ata_cable_ignore,
395 .mode_filter = nv_mode_filter,
396 .error_handler = nv_error_handler,
397 .host_stop = nv_host_stop,
489}; 398};
490 399
491static struct ata_port_operations nv100_port_ops = { 400static struct ata_port_operations nv100_port_ops = {
401 .inherits = &nv_base_port_ops,
492 .set_piomode = nv100_set_piomode, 402 .set_piomode = nv100_set_piomode,
493 .set_dmamode = nv100_set_dmamode, 403 .set_dmamode = nv100_set_dmamode,
494 .tf_load = ata_tf_load,
495 .tf_read = ata_tf_read,
496 .check_status = ata_check_status,
497 .exec_command = ata_exec_command,
498 .dev_select = ata_std_dev_select,
499
500 .freeze = ata_bmdma_freeze,
501 .thaw = ata_bmdma_thaw,
502 .error_handler = nv_error_handler,
503 .post_internal_cmd = ata_bmdma_post_internal_cmd,
504 .cable_detect = ata_cable_ignore,
505 .mode_filter = nv_mode_filter,
506
507 .bmdma_setup = ata_bmdma_setup,
508 .bmdma_start = ata_bmdma_start,
509 .bmdma_stop = ata_bmdma_stop,
510 .bmdma_status = ata_bmdma_status,
511
512 .qc_prep = ata_qc_prep,
513 .qc_issue = ata_qc_issue_prot,
514
515 .data_xfer = ata_data_xfer,
516
517 .irq_handler = ata_interrupt,
518 .irq_clear = ata_bmdma_irq_clear,
519 .irq_on = ata_irq_on,
520
521 .port_start = ata_sff_port_start,
522 .host_stop = nv_host_stop,
523}; 404};
524 405
525static struct ata_port_operations nv133_port_ops = { 406static struct ata_port_operations nv133_port_ops = {
407 .inherits = &nv_base_port_ops,
526 .set_piomode = nv133_set_piomode, 408 .set_piomode = nv133_set_piomode,
527 .set_dmamode = nv133_set_dmamode, 409 .set_dmamode = nv133_set_dmamode,
528 .tf_load = ata_tf_load,
529 .tf_read = ata_tf_read,
530 .check_status = ata_check_status,
531 .exec_command = ata_exec_command,
532 .dev_select = ata_std_dev_select,
533
534 .freeze = ata_bmdma_freeze,
535 .thaw = ata_bmdma_thaw,
536 .error_handler = nv_error_handler,
537 .post_internal_cmd = ata_bmdma_post_internal_cmd,
538 .cable_detect = ata_cable_ignore,
539 .mode_filter = nv_mode_filter,
540
541 .bmdma_setup = ata_bmdma_setup,
542 .bmdma_start = ata_bmdma_start,
543 .bmdma_stop = ata_bmdma_stop,
544 .bmdma_status = ata_bmdma_status,
545
546 .qc_prep = ata_qc_prep,
547 .qc_issue = ata_qc_issue_prot,
548
549 .data_xfer = ata_data_xfer,
550
551 .irq_handler = ata_interrupt,
552 .irq_clear = ata_bmdma_irq_clear,
553 .irq_on = ata_irq_on,
554
555 .port_start = ata_sff_port_start,
556 .host_stop = nv_host_stop,
557}; 410};
558 411
559static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 412static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 7bfb7e8bdca2..0101e5aef3e0 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -317,69 +317,20 @@ static struct scsi_host_template artop_sht = {
317 ATA_BMDMA_SHT(DRV_NAME), 317 ATA_BMDMA_SHT(DRV_NAME),
318}; 318};
319 319
320static const struct ata_port_operations artop6210_ops = { 320static struct ata_port_operations artop6210_ops = {
321 .inherits = &ata_bmdma_port_ops,
322 .cable_detect = ata_cable_40wire,
321 .set_piomode = artop6210_set_piomode, 323 .set_piomode = artop6210_set_piomode,
322 .set_dmamode = artop6210_set_dmamode, 324 .set_dmamode = artop6210_set_dmamode,
323 .mode_filter = ata_pci_default_filter,
324
325 .tf_load = ata_tf_load,
326 .tf_read = ata_tf_read,
327 .check_status = ata_check_status,
328 .exec_command = ata_exec_command,
329 .dev_select = ata_std_dev_select,
330
331 .freeze = ata_bmdma_freeze,
332 .thaw = ata_bmdma_thaw,
333 .error_handler = artop6210_error_handler, 325 .error_handler = artop6210_error_handler,
334 .post_internal_cmd = ata_bmdma_post_internal_cmd,
335 .cable_detect = ata_cable_40wire,
336
337 .bmdma_setup = ata_bmdma_setup,
338 .bmdma_start = ata_bmdma_start,
339 .bmdma_stop = ata_bmdma_stop,
340 .bmdma_status = ata_bmdma_status,
341 .qc_prep = ata_qc_prep,
342 .qc_issue = ata_qc_issue_prot,
343
344 .data_xfer = ata_data_xfer,
345
346 .irq_handler = ata_interrupt,
347 .irq_clear = ata_bmdma_irq_clear,
348 .irq_on = ata_irq_on,
349
350 .port_start = ata_sff_port_start,
351}; 326};
352 327
353static const struct ata_port_operations artop6260_ops = { 328static struct ata_port_operations artop6260_ops = {
329 .inherits = &ata_bmdma_port_ops,
330 .cable_detect = artop6260_cable_detect,
354 .set_piomode = artop6260_set_piomode, 331 .set_piomode = artop6260_set_piomode,
355 .set_dmamode = artop6260_set_dmamode, 332 .set_dmamode = artop6260_set_dmamode,
356 .mode_filter = ata_pci_default_filter,
357
358 .tf_load = ata_tf_load,
359 .tf_read = ata_tf_read,
360 .check_status = ata_check_status,
361 .exec_command = ata_exec_command,
362 .dev_select = ata_std_dev_select,
363
364 .freeze = ata_bmdma_freeze,
365 .thaw = ata_bmdma_thaw,
366 .error_handler = artop6260_error_handler, 333 .error_handler = artop6260_error_handler,
367 .post_internal_cmd = ata_bmdma_post_internal_cmd,
368 .cable_detect = artop6260_cable_detect,
369
370 .bmdma_setup = ata_bmdma_setup,
371 .bmdma_start = ata_bmdma_start,
372 .bmdma_stop = ata_bmdma_stop,
373 .bmdma_status = ata_bmdma_status,
374 .qc_prep = ata_qc_prep,
375 .qc_issue = ata_qc_issue_prot,
376 .data_xfer = ata_data_xfer,
377
378 .irq_handler = ata_interrupt,
379 .irq_clear = ata_bmdma_irq_clear,
380 .irq_on = ata_irq_on,
381
382 .port_start = ata_sff_port_start,
383}; 334};
384 335
385 336
diff --git a/drivers/ata/pata_at32.c b/drivers/ata/pata_at32.c
index d7b7b7fde362..528315587532 100644
--- a/drivers/ata/pata_at32.c
+++ b/drivers/ata/pata_at32.c
@@ -171,28 +171,9 @@ static struct scsi_host_template at32_sht = {
171}; 171};
172 172
173static struct ata_port_operations at32_port_ops = { 173static struct ata_port_operations at32_port_ops = {
174 .set_piomode = pata_at32_set_piomode, 174 .inherits = &ata_sff_port_ops,
175 .tf_load = ata_tf_load,
176 .tf_read = ata_tf_read,
177 .exec_command = ata_exec_command,
178 .check_status = ata_check_status,
179 .dev_select = ata_std_dev_select,
180
181 .freeze = ata_bmdma_freeze,
182 .thaw = ata_bmdma_thaw,
183 .error_handler = ata_bmdma_error_handler,
184 .post_internal_cmd = ata_bmdma_post_internal_cmd,
185 .cable_detect = ata_cable_40wire, 175 .cable_detect = ata_cable_40wire,
186 176 .set_piomode = pata_at32_set_piomode,
187 .qc_prep = ata_qc_prep,
188 .qc_issue = ata_qc_issue_prot,
189
190 .data_xfer = ata_data_xfer,
191
192 .irq_clear = ata_noop_irq_clear,
193 .irq_on = ata_irq_on,
194
195 .port_start = ata_sff_port_start,
196}; 177};
197 178
198static int __init pata_at32_init_one(struct device *dev, 179static int __init pata_at32_init_one(struct device *dev,
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index 645c47271ff5..2655f6a17ad3 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -226,36 +226,16 @@ static struct scsi_host_template atiixp_sht = {
226}; 226};
227 227
228static struct ata_port_operations atiixp_port_ops = { 228static struct ata_port_operations atiixp_port_ops = {
229 .set_piomode = atiixp_set_piomode, 229 .inherits = &ata_bmdma_port_ops,
230 .set_dmamode = atiixp_set_dmamode,
231 .mode_filter = ata_pci_default_filter,
232 .tf_load = ata_tf_load,
233 .tf_read = ata_tf_read,
234 .check_status = ata_check_status,
235 .exec_command = ata_exec_command,
236 .dev_select = ata_std_dev_select,
237
238 .freeze = ata_bmdma_freeze,
239 .thaw = ata_bmdma_thaw,
240 .error_handler = atiixp_error_handler,
241 .post_internal_cmd = ata_bmdma_post_internal_cmd,
242 .cable_detect = atiixp_cable_detect,
243 230
244 .bmdma_setup = ata_bmdma_setup, 231 .qc_prep = ata_dumb_qc_prep,
245 .bmdma_start = atiixp_bmdma_start, 232 .bmdma_start = atiixp_bmdma_start,
246 .bmdma_stop = atiixp_bmdma_stop, 233 .bmdma_stop = atiixp_bmdma_stop,
247 .bmdma_status = ata_bmdma_status,
248
249 .qc_prep = ata_dumb_qc_prep,
250 .qc_issue = ata_qc_issue_prot,
251 234
252 .data_xfer = ata_data_xfer, 235 .cable_detect = atiixp_cable_detect,
253 236 .set_piomode = atiixp_set_piomode,
254 .irq_handler = ata_interrupt, 237 .set_dmamode = atiixp_set_dmamode,
255 .irq_clear = ata_bmdma_irq_clear, 238 .error_handler = atiixp_error_handler,
256 .irq_on = ata_irq_on,
257
258 .port_start = ata_sff_port_start,
259}; 239};
260 240
261static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id) 241static int atiixp_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 6c75fcac3cf4..7a22ef483061 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1363,6 +1363,8 @@ static struct scsi_host_template bfin_sht = {
1363}; 1363};
1364 1364
1365static const struct ata_port_operations bfin_pata_ops = { 1365static const struct ata_port_operations bfin_pata_ops = {
1366 .inherits = &ata_sff_port_ops,
1367
1366 .set_piomode = bfin_set_piomode, 1368 .set_piomode = bfin_set_piomode,
1367 .set_dmamode = bfin_set_dmamode, 1369 .set_dmamode = bfin_set_dmamode,
1368 1370
@@ -1380,14 +1382,12 @@ static const struct ata_port_operations bfin_pata_ops = {
1380 .data_xfer = bfin_data_xfer, 1382 .data_xfer = bfin_data_xfer,
1381 1383
1382 .qc_prep = ata_noop_qc_prep, 1384 .qc_prep = ata_noop_qc_prep,
1383 .qc_issue = ata_qc_issue_prot,
1384 1385
1385 .freeze = bfin_bmdma_freeze, 1386 .freeze = bfin_bmdma_freeze,
1386 .thaw = bfin_bmdma_thaw, 1387 .thaw = bfin_bmdma_thaw,
1387 .error_handler = bfin_error_handler, 1388 .error_handler = bfin_error_handler,
1388 .post_internal_cmd = bfin_bmdma_stop, 1389 .post_internal_cmd = bfin_bmdma_stop,
1389 1390
1390 .irq_handler = ata_interrupt,
1391 .irq_clear = bfin_irq_clear, 1391 .irq_clear = bfin_irq_clear,
1392 .irq_on = bfin_irq_on, 1392 .irq_on = bfin_irq_on,
1393 1393
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c
index 26562b814400..061c891c8a66 100644
--- a/drivers/ata/pata_cmd640.c
+++ b/drivers/ata/pata_cmd640.c
@@ -170,35 +170,12 @@ static struct scsi_host_template cmd640_sht = {
170}; 170};
171 171
172static struct ata_port_operations cmd640_port_ops = { 172static struct ata_port_operations cmd640_port_ops = {
173 .set_piomode = cmd640_set_piomode, 173 .inherits = &ata_bmdma_port_ops,
174 .mode_filter = ata_pci_default_filter, 174 /* In theory xfer_noirq is not needed once we kill the prefetcher */
175 .tf_load = ata_tf_load,
176 .tf_read = ata_tf_read,
177 .check_status = ata_check_status,
178 .exec_command = ata_exec_command,
179 .dev_select = ata_std_dev_select,
180
181 .freeze = ata_bmdma_freeze,
182 .thaw = ata_bmdma_thaw,
183 .error_handler = ata_bmdma_error_handler,
184 .post_internal_cmd = ata_bmdma_post_internal_cmd,
185 .cable_detect = ata_cable_40wire,
186
187 .bmdma_setup = ata_bmdma_setup,
188 .bmdma_start = ata_bmdma_start,
189 .bmdma_stop = ata_bmdma_stop,
190 .bmdma_status = ata_bmdma_status,
191
192 .qc_prep = ata_qc_prep,
193 .qc_issue = cmd640_qc_issue_prot,
194
195 /* In theory this is not needed once we kill the prefetcher */
196 .data_xfer = ata_data_xfer_noirq, 175 .data_xfer = ata_data_xfer_noirq,
197 176 .qc_issue = cmd640_qc_issue_prot,
198 .irq_handler = ata_interrupt, 177 .cable_detect = ata_cable_40wire,
199 .irq_clear = ata_bmdma_irq_clear, 178 .set_piomode = cmd640_set_piomode,
200 .irq_on = ata_irq_on,
201
202 .port_start = cmd640_port_start, 179 .port_start = cmd640_port_start,
203}; 180};
204 181
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index 6aea05cc0940..1ac8ecfb97e2 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -269,103 +269,27 @@ static struct scsi_host_template cmd64x_sht = {
269 ATA_BMDMA_SHT(DRV_NAME), 269 ATA_BMDMA_SHT(DRV_NAME),
270}; 270};
271 271
272static struct ata_port_operations cmd64x_port_ops = { 272static const struct ata_port_operations cmd64x_base_ops = {
273 .inherits = &ata_bmdma_port_ops,
273 .set_piomode = cmd64x_set_piomode, 274 .set_piomode = cmd64x_set_piomode,
274 .set_dmamode = cmd64x_set_dmamode, 275 .set_dmamode = cmd64x_set_dmamode,
275 .mode_filter = ata_pci_default_filter,
276 .tf_load = ata_tf_load,
277 .tf_read = ata_tf_read,
278 .check_status = ata_check_status,
279 .exec_command = ata_exec_command,
280 .dev_select = ata_std_dev_select,
281
282 .freeze = ata_bmdma_freeze,
283 .thaw = ata_bmdma_thaw,
284 .error_handler = ata_bmdma_error_handler,
285 .post_internal_cmd = ata_bmdma_post_internal_cmd,
286 .cable_detect = ata_cable_40wire,
287
288 .bmdma_setup = ata_bmdma_setup,
289 .bmdma_start = ata_bmdma_start,
290 .bmdma_stop = ata_bmdma_stop,
291 .bmdma_status = ata_bmdma_status,
292
293 .qc_prep = ata_qc_prep,
294 .qc_issue = ata_qc_issue_prot,
295
296 .data_xfer = ata_data_xfer,
297
298 .irq_handler = ata_interrupt,
299 .irq_clear = ata_bmdma_irq_clear,
300 .irq_on = ata_irq_on,
301
302 .port_start = ata_sff_port_start,
303}; 276};
304 277
305static struct ata_port_operations cmd646r1_port_ops = { 278static struct ata_port_operations cmd64x_port_ops = {
306 .set_piomode = cmd64x_set_piomode, 279 .inherits = &cmd64x_base_ops,
307 .set_dmamode = cmd64x_set_dmamode,
308 .mode_filter = ata_pci_default_filter,
309 .tf_load = ata_tf_load,
310 .tf_read = ata_tf_read,
311 .check_status = ata_check_status,
312 .exec_command = ata_exec_command,
313 .dev_select = ata_std_dev_select,
314
315 .freeze = ata_bmdma_freeze,
316 .thaw = ata_bmdma_thaw,
317 .error_handler = ata_bmdma_error_handler,
318 .post_internal_cmd = ata_bmdma_post_internal_cmd,
319 .cable_detect = ata_cable_40wire, 280 .cable_detect = ata_cable_40wire,
281};
320 282
321 .bmdma_setup = ata_bmdma_setup, 283static struct ata_port_operations cmd646r1_port_ops = {
322 .bmdma_start = ata_bmdma_start, 284 .inherits = &cmd64x_base_ops,
323 .bmdma_stop = cmd646r1_bmdma_stop, 285 .bmdma_stop = cmd646r1_bmdma_stop,
324 .bmdma_status = ata_bmdma_status, 286 .cable_detect = ata_cable_40wire,
325
326 .qc_prep = ata_qc_prep,
327 .qc_issue = ata_qc_issue_prot,
328
329 .data_xfer = ata_data_xfer,
330
331 .irq_handler = ata_interrupt,
332 .irq_clear = ata_bmdma_irq_clear,
333 .irq_on = ata_irq_on,
334
335 .port_start = ata_sff_port_start,
336}; 287};
337 288
338static struct ata_port_operations cmd648_port_ops = { 289static struct ata_port_operations cmd648_port_ops = {
339 .set_piomode = cmd64x_set_piomode, 290 .inherits = &cmd64x_base_ops,
340 .set_dmamode = cmd64x_set_dmamode,
341 .mode_filter = ata_pci_default_filter,
342 .tf_load = ata_tf_load,
343 .tf_read = ata_tf_read,
344 .check_status = ata_check_status,
345 .exec_command = ata_exec_command,
346 .dev_select = ata_std_dev_select,
347
348 .freeze = ata_bmdma_freeze,
349 .thaw = ata_bmdma_thaw,
350 .error_handler = ata_bmdma_error_handler,
351 .post_internal_cmd = ata_bmdma_post_internal_cmd,
352 .cable_detect = cmd648_cable_detect,
353
354 .bmdma_setup = ata_bmdma_setup,
355 .bmdma_start = ata_bmdma_start,
356 .bmdma_stop = cmd648_bmdma_stop, 291 .bmdma_stop = cmd648_bmdma_stop,
357 .bmdma_status = ata_bmdma_status, 292 .cable_detect = cmd648_cable_detect,
358
359 .qc_prep = ata_qc_prep,
360 .qc_issue = ata_qc_issue_prot,
361
362 .data_xfer = ata_data_xfer,
363
364 .irq_handler = ata_interrupt,
365 .irq_clear = ata_bmdma_irq_clear,
366 .irq_on = ata_irq_on,
367
368 .port_start = ata_sff_port_start,
369}; 293};
370 294
371static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 295static int cmd64x_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 7e643099a444..46d0ce32ee5a 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -145,34 +145,11 @@ static struct scsi_host_template cs5520_sht = {
145}; 145};
146 146
147static struct ata_port_operations cs5520_port_ops = { 147static struct ata_port_operations cs5520_port_ops = {
148 .inherits = &ata_bmdma_port_ops,
149 .qc_prep = ata_dumb_qc_prep,
150 .cable_detect = ata_cable_40wire,
148 .set_piomode = cs5520_set_piomode, 151 .set_piomode = cs5520_set_piomode,
149 .set_dmamode = cs5520_set_dmamode, 152 .set_dmamode = cs5520_set_dmamode,
150 .mode_filter = ata_pci_default_filter,
151
152 .tf_load = ata_tf_load,
153 .tf_read = ata_tf_read,
154 .check_status = ata_check_status,
155 .exec_command = ata_exec_command,
156 .dev_select = ata_std_dev_select,
157
158 .freeze = ata_bmdma_freeze,
159 .thaw = ata_bmdma_thaw,
160 .error_handler = ata_bmdma_error_handler,
161 .post_internal_cmd = ata_bmdma_post_internal_cmd,
162 .cable_detect = ata_cable_40wire,
163
164 .bmdma_setup = ata_bmdma_setup,
165 .bmdma_start = ata_bmdma_start,
166 .bmdma_stop = ata_bmdma_stop,
167 .bmdma_status = ata_bmdma_status,
168 .qc_prep = ata_dumb_qc_prep,
169 .qc_issue = ata_qc_issue_prot,
170 .data_xfer = ata_data_xfer,
171
172 .irq_clear = ata_bmdma_irq_clear,
173 .irq_on = ata_irq_on,
174
175 .port_start = ata_sff_port_start,
176}; 153};
177 154
178static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 155static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index 0bb03dabcf18..e4a16a578cac 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -166,37 +166,14 @@ static struct scsi_host_template cs5530_sht = {
166}; 166};
167 167
168static struct ata_port_operations cs5530_port_ops = { 168static struct ata_port_operations cs5530_port_ops = {
169 .set_piomode = cs5530_set_piomode, 169 .inherits = &ata_bmdma_port_ops,
170 .set_dmamode = cs5530_set_dmamode,
171 .mode_filter = ata_pci_default_filter,
172
173 .tf_load = ata_tf_load,
174 .tf_read = ata_tf_read,
175 .check_status = ata_check_status,
176 .exec_command = ata_exec_command,
177 .dev_select = ata_std_dev_select,
178
179 .bmdma_setup = ata_bmdma_setup,
180 .bmdma_start = ata_bmdma_start,
181 .bmdma_stop = ata_bmdma_stop,
182 .bmdma_status = ata_bmdma_status,
183
184 .freeze = ata_bmdma_freeze,
185 .thaw = ata_bmdma_thaw,
186 .error_handler = ata_bmdma_error_handler,
187 .post_internal_cmd = ata_bmdma_post_internal_cmd,
188 .cable_detect = ata_cable_40wire,
189 170
190 .qc_prep = ata_dumb_qc_prep, 171 .qc_prep = ata_dumb_qc_prep,
191 .qc_issue = cs5530_qc_issue_prot, 172 .qc_issue = cs5530_qc_issue_prot,
192 173
193 .data_xfer = ata_data_xfer, 174 .cable_detect = ata_cable_40wire,
194 175 .set_piomode = cs5530_set_piomode,
195 .irq_handler = ata_interrupt, 176 .set_dmamode = cs5530_set_dmamode,
196 .irq_clear = ata_bmdma_irq_clear,
197 .irq_on = ata_irq_on,
198
199 .port_start = ata_sff_port_start,
200}; 177};
201 178
202static const struct dmi_system_id palmax_dmi_table[] = { 179static const struct dmi_system_id palmax_dmi_table[] = {
diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c
index 48a18349c1d8..f910a8aa7437 100644
--- a/drivers/ata/pata_cs5535.c
+++ b/drivers/ata/pata_cs5535.c
@@ -162,37 +162,10 @@ static struct scsi_host_template cs5535_sht = {
162}; 162};
163 163
164static struct ata_port_operations cs5535_port_ops = { 164static struct ata_port_operations cs5535_port_ops = {
165 .inherits = &ata_bmdma_port_ops,
166 .cable_detect = cs5535_cable_detect,
165 .set_piomode = cs5535_set_piomode, 167 .set_piomode = cs5535_set_piomode,
166 .set_dmamode = cs5535_set_dmamode, 168 .set_dmamode = cs5535_set_dmamode,
167 .mode_filter = ata_pci_default_filter,
168
169 .tf_load = ata_tf_load,
170 .tf_read = ata_tf_read,
171 .check_status = ata_check_status,
172 .exec_command = ata_exec_command,
173 .dev_select = ata_std_dev_select,
174
175 .freeze = ata_bmdma_freeze,
176 .thaw = ata_bmdma_thaw,
177 .error_handler = ata_bmdma_error_handler,
178 .post_internal_cmd = ata_bmdma_post_internal_cmd,
179 .cable_detect = cs5535_cable_detect,
180
181 .bmdma_setup = ata_bmdma_setup,
182 .bmdma_start = ata_bmdma_start,
183 .bmdma_stop = ata_bmdma_stop,
184 .bmdma_status = ata_bmdma_status,
185
186 .qc_prep = ata_qc_prep,
187 .qc_issue = ata_qc_issue_prot,
188
189 .data_xfer = ata_data_xfer,
190
191 .irq_handler = ata_interrupt,
192 .irq_clear = ata_bmdma_irq_clear,
193 .irq_on = ata_irq_on,
194
195 .port_start = ata_sff_port_start,
196}; 169};
197 170
198/** 171/**
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index f02d9107ef3b..075ee6a7be39 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -225,37 +225,10 @@ static struct scsi_host_template cs5536_sht = {
225}; 225};
226 226
227static struct ata_port_operations cs5536_port_ops = { 227static struct ata_port_operations cs5536_port_ops = {
228 .inherits = &ata_bmdma_port_ops,
229 .cable_detect = cs5536_cable_detect,
228 .set_piomode = cs5536_set_piomode, 230 .set_piomode = cs5536_set_piomode,
229 .set_dmamode = cs5536_set_dmamode, 231 .set_dmamode = cs5536_set_dmamode,
230 .mode_filter = ata_pci_default_filter,
231
232 .tf_load = ata_tf_load,
233 .tf_read = ata_tf_read,
234 .check_status = ata_check_status,
235 .exec_command = ata_exec_command,
236 .dev_select = ata_std_dev_select,
237
238 .freeze = ata_bmdma_freeze,
239 .thaw = ata_bmdma_thaw,
240 .error_handler = ata_bmdma_error_handler,
241 .post_internal_cmd = ata_bmdma_post_internal_cmd,
242 .cable_detect = cs5536_cable_detect,
243
244 .bmdma_setup = ata_bmdma_setup,
245 .bmdma_start = ata_bmdma_start,
246 .bmdma_stop = ata_bmdma_stop,
247 .bmdma_status = ata_bmdma_status,
248
249 .qc_prep = ata_qc_prep,
250 .qc_issue = ata_qc_issue_prot,
251
252 .data_xfer = ata_data_xfer,
253
254 .irq_handler = ata_interrupt,
255 .irq_clear = ata_bmdma_irq_clear,
256 .irq_on = ata_irq_on,
257
258 .port_start = ata_sff_port_start,
259}; 232};
260 233
261/** 234/**
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c
index 07fa1ab36315..c459553e7d1e 100644
--- a/drivers/ata/pata_cypress.c
+++ b/drivers/ata/pata_cypress.c
@@ -114,37 +114,10 @@ static struct scsi_host_template cy82c693_sht = {
114}; 114};
115 115
116static struct ata_port_operations cy82c693_port_ops = { 116static struct ata_port_operations cy82c693_port_ops = {
117 .inherits = &ata_bmdma_port_ops,
118 .cable_detect = ata_cable_40wire,
117 .set_piomode = cy82c693_set_piomode, 119 .set_piomode = cy82c693_set_piomode,
118 .set_dmamode = cy82c693_set_dmamode, 120 .set_dmamode = cy82c693_set_dmamode,
119 .mode_filter = ata_pci_default_filter,
120
121 .tf_load = ata_tf_load,
122 .tf_read = ata_tf_read,
123 .check_status = ata_check_status,
124 .exec_command = ata_exec_command,
125 .dev_select = ata_std_dev_select,
126
127 .freeze = ata_bmdma_freeze,
128 .thaw = ata_bmdma_thaw,
129 .error_handler = ata_bmdma_error_handler,
130 .post_internal_cmd = ata_bmdma_post_internal_cmd,
131 .cable_detect = ata_cable_40wire,
132
133 .bmdma_setup = ata_bmdma_setup,
134 .bmdma_start = ata_bmdma_start,
135 .bmdma_stop = ata_bmdma_stop,
136 .bmdma_status = ata_bmdma_status,
137
138 .qc_prep = ata_qc_prep,
139 .qc_issue = ata_qc_issue_prot,
140
141 .data_xfer = ata_data_xfer,
142
143 .irq_handler = ata_interrupt,
144 .irq_clear = ata_bmdma_irq_clear,
145 .irq_on = ata_irq_on,
146
147 .port_start = ata_sff_port_start,
148}; 121};
149 122
150static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 123static int cy82c693_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_efar.c b/drivers/ata/pata_efar.c
index 8700d9dcd8c9..ef62fc642c17 100644
--- a/drivers/ata/pata_efar.c
+++ b/drivers/ata/pata_efar.c
@@ -236,36 +236,12 @@ static struct scsi_host_template efar_sht = {
236 ATA_BMDMA_SHT(DRV_NAME), 236 ATA_BMDMA_SHT(DRV_NAME),
237}; 237};
238 238
239static const struct ata_port_operations efar_ops = { 239static struct ata_port_operations efar_ops = {
240 .inherits = &ata_bmdma_port_ops,
241 .cable_detect = efar_cable_detect,
240 .set_piomode = efar_set_piomode, 242 .set_piomode = efar_set_piomode,
241 .set_dmamode = efar_set_dmamode, 243 .set_dmamode = efar_set_dmamode,
242 .mode_filter = ata_pci_default_filter,
243
244 .tf_load = ata_tf_load,
245 .tf_read = ata_tf_read,
246 .check_status = ata_check_status,
247 .exec_command = ata_exec_command,
248 .dev_select = ata_std_dev_select,
249
250 .freeze = ata_bmdma_freeze,
251 .thaw = ata_bmdma_thaw,
252 .error_handler = efar_error_handler, 244 .error_handler = efar_error_handler,
253 .post_internal_cmd = ata_bmdma_post_internal_cmd,
254 .cable_detect = efar_cable_detect,
255
256 .bmdma_setup = ata_bmdma_setup,
257 .bmdma_start = ata_bmdma_start,
258 .bmdma_stop = ata_bmdma_stop,
259 .bmdma_status = ata_bmdma_status,
260 .qc_prep = ata_qc_prep,
261 .qc_issue = ata_qc_issue_prot,
262 .data_xfer = ata_data_xfer,
263
264 .irq_handler = ata_interrupt,
265 .irq_clear = ata_bmdma_irq_clear,
266 .irq_on = ata_irq_on,
267
268 .port_start = ata_sff_port_start,
269}; 245};
270 246
271 247
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index a30028de41c0..788955f57ff8 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -298,37 +298,11 @@ static struct scsi_host_template hpt36x_sht = {
298 */ 298 */
299 299
300static struct ata_port_operations hpt366_port_ops = { 300static struct ata_port_operations hpt366_port_ops = {
301 .inherits = &ata_bmdma_port_ops,
302 .cable_detect = hpt36x_cable_detect,
303 .mode_filter = hpt366_filter,
301 .set_piomode = hpt366_set_piomode, 304 .set_piomode = hpt366_set_piomode,
302 .set_dmamode = hpt366_set_dmamode, 305 .set_dmamode = hpt366_set_dmamode,
303 .mode_filter = hpt366_filter,
304
305 .tf_load = ata_tf_load,
306 .tf_read = ata_tf_read,
307 .check_status = ata_check_status,
308 .exec_command = ata_exec_command,
309 .dev_select = ata_std_dev_select,
310
311 .freeze = ata_bmdma_freeze,
312 .thaw = ata_bmdma_thaw,
313 .error_handler = ata_bmdma_error_handler,
314 .post_internal_cmd = ata_bmdma_post_internal_cmd,
315 .cable_detect = hpt36x_cable_detect,
316
317 .bmdma_setup = ata_bmdma_setup,
318 .bmdma_start = ata_bmdma_start,
319 .bmdma_stop = ata_bmdma_stop,
320 .bmdma_status = ata_bmdma_status,
321
322 .qc_prep = ata_qc_prep,
323 .qc_issue = ata_qc_issue_prot,
324
325 .data_xfer = ata_data_xfer,
326
327 .irq_handler = ata_interrupt,
328 .irq_clear = ata_bmdma_irq_clear,
329 .irq_on = ata_irq_on,
330
331 .port_start = ata_sff_port_start,
332}; 306};
333 307
334/** 308/**
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 7d6fac43e2f9..c42eec70d297 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -627,36 +627,15 @@ static struct scsi_host_template hpt37x_sht = {
627 */ 627 */
628 628
629static struct ata_port_operations hpt370_port_ops = { 629static struct ata_port_operations hpt370_port_ops = {
630 .set_piomode = hpt370_set_piomode, 630 .inherits = &ata_bmdma_port_ops,
631 .set_dmamode = hpt370_set_dmamode,
632 .mode_filter = hpt370_filter,
633
634 .tf_load = ata_tf_load,
635 .tf_read = ata_tf_read,
636 .check_status = ata_check_status,
637 .exec_command = ata_exec_command,
638 .dev_select = ata_std_dev_select,
639
640 .freeze = ata_bmdma_freeze,
641 .thaw = ata_bmdma_thaw,
642 .error_handler = hpt37x_error_handler,
643 .post_internal_cmd = ata_bmdma_post_internal_cmd,
644 631
645 .bmdma_setup = ata_bmdma_setup,
646 .bmdma_start = hpt370_bmdma_start, 632 .bmdma_start = hpt370_bmdma_start,
647 .bmdma_stop = hpt370_bmdma_stop, 633 .bmdma_stop = hpt370_bmdma_stop,
648 .bmdma_status = ata_bmdma_status,
649 634
650 .qc_prep = ata_qc_prep, 635 .mode_filter = hpt370_filter,
651 .qc_issue = ata_qc_issue_prot, 636 .set_piomode = hpt370_set_piomode,
652 637 .set_dmamode = hpt370_set_dmamode,
653 .data_xfer = ata_data_xfer, 638 .error_handler = hpt37x_error_handler,
654
655 .irq_handler = ata_interrupt,
656 .irq_clear = ata_bmdma_irq_clear,
657 .irq_on = ata_irq_on,
658
659 .port_start = ata_sff_port_start,
660}; 639};
661 640
662/* 641/*
@@ -664,36 +643,8 @@ static struct ata_port_operations hpt370_port_ops = {
664 */ 643 */
665 644
666static struct ata_port_operations hpt370a_port_ops = { 645static struct ata_port_operations hpt370a_port_ops = {
667 .set_piomode = hpt370_set_piomode, 646 .inherits = &hpt370_port_ops,
668 .set_dmamode = hpt370_set_dmamode,
669 .mode_filter = hpt370a_filter, 647 .mode_filter = hpt370a_filter,
670
671 .tf_load = ata_tf_load,
672 .tf_read = ata_tf_read,
673 .check_status = ata_check_status,
674 .exec_command = ata_exec_command,
675 .dev_select = ata_std_dev_select,
676
677 .freeze = ata_bmdma_freeze,
678 .thaw = ata_bmdma_thaw,
679 .error_handler = hpt37x_error_handler,
680 .post_internal_cmd = ata_bmdma_post_internal_cmd,
681
682 .bmdma_setup = ata_bmdma_setup,
683 .bmdma_start = hpt370_bmdma_start,
684 .bmdma_stop = hpt370_bmdma_stop,
685 .bmdma_status = ata_bmdma_status,
686
687 .qc_prep = ata_qc_prep,
688 .qc_issue = ata_qc_issue_prot,
689
690 .data_xfer = ata_data_xfer,
691
692 .irq_handler = ata_interrupt,
693 .irq_clear = ata_bmdma_irq_clear,
694 .irq_on = ata_irq_on,
695
696 .port_start = ata_sff_port_start,
697}; 648};
698 649
699/* 650/*
@@ -702,36 +653,13 @@ static struct ata_port_operations hpt370a_port_ops = {
702 */ 653 */
703 654
704static struct ata_port_operations hpt372_port_ops = { 655static struct ata_port_operations hpt372_port_ops = {
705 .set_piomode = hpt372_set_piomode, 656 .inherits = &ata_bmdma_port_ops,
706 .set_dmamode = hpt372_set_dmamode,
707 .mode_filter = ata_pci_default_filter,
708
709 .tf_load = ata_tf_load,
710 .tf_read = ata_tf_read,
711 .check_status = ata_check_status,
712 .exec_command = ata_exec_command,
713 .dev_select = ata_std_dev_select,
714
715 .freeze = ata_bmdma_freeze,
716 .thaw = ata_bmdma_thaw,
717 .error_handler = hpt37x_error_handler,
718 .post_internal_cmd = ata_bmdma_post_internal_cmd,
719 657
720 .bmdma_setup = ata_bmdma_setup,
721 .bmdma_start = ata_bmdma_start,
722 .bmdma_stop = hpt37x_bmdma_stop, 658 .bmdma_stop = hpt37x_bmdma_stop,
723 .bmdma_status = ata_bmdma_status,
724
725 .qc_prep = ata_qc_prep,
726 .qc_issue = ata_qc_issue_prot,
727
728 .data_xfer = ata_data_xfer,
729 659
730 .irq_handler = ata_interrupt, 660 .set_piomode = hpt372_set_piomode,
731 .irq_clear = ata_bmdma_irq_clear, 661 .set_dmamode = hpt372_set_dmamode,
732 .irq_on = ata_irq_on, 662 .error_handler = hpt37x_error_handler,
733
734 .port_start = ata_sff_port_start,
735}; 663};
736 664
737/* 665/*
@@ -740,36 +668,8 @@ static struct ata_port_operations hpt372_port_ops = {
740 */ 668 */
741 669
742static struct ata_port_operations hpt374_port_ops = { 670static struct ata_port_operations hpt374_port_ops = {
743 .set_piomode = hpt372_set_piomode, 671 .inherits = &hpt372_port_ops,
744 .set_dmamode = hpt372_set_dmamode,
745 .mode_filter = ata_pci_default_filter,
746
747 .tf_load = ata_tf_load,
748 .tf_read = ata_tf_read,
749 .check_status = ata_check_status,
750 .exec_command = ata_exec_command,
751 .dev_select = ata_std_dev_select,
752
753 .freeze = ata_bmdma_freeze,
754 .thaw = ata_bmdma_thaw,
755 .error_handler = hpt374_error_handler, 672 .error_handler = hpt374_error_handler,
756 .post_internal_cmd = ata_bmdma_post_internal_cmd,
757
758 .bmdma_setup = ata_bmdma_setup,
759 .bmdma_start = ata_bmdma_start,
760 .bmdma_stop = hpt37x_bmdma_stop,
761 .bmdma_status = ata_bmdma_status,
762
763 .qc_prep = ata_qc_prep,
764 .qc_issue = ata_qc_issue_prot,
765
766 .data_xfer = ata_data_xfer,
767
768 .irq_handler = ata_interrupt,
769 .irq_clear = ata_bmdma_irq_clear,
770 .irq_on = ata_irq_on,
771
772 .port_start = ata_sff_port_start,
773}; 673};
774 674
775/** 675/**
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index aa380c46b168..b77b1279d757 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -347,37 +347,15 @@ static struct scsi_host_template hpt3x2n_sht = {
347 */ 347 */
348 348
349static struct ata_port_operations hpt3x2n_port_ops = { 349static struct ata_port_operations hpt3x2n_port_ops = {
350 .set_piomode = hpt3x2n_set_piomode, 350 .inherits = &ata_bmdma_port_ops,
351 .set_dmamode = hpt3x2n_set_dmamode,
352 .mode_filter = ata_pci_default_filter,
353 351
354 .tf_load = ata_tf_load,
355 .tf_read = ata_tf_read,
356 .check_status = ata_check_status,
357 .exec_command = ata_exec_command,
358 .dev_select = ata_std_dev_select,
359
360 .freeze = ata_bmdma_freeze,
361 .thaw = ata_bmdma_thaw,
362 .error_handler = hpt3x2n_error_handler,
363 .post_internal_cmd = ata_bmdma_post_internal_cmd,
364 .cable_detect = hpt3x2n_cable_detect,
365
366 .bmdma_setup = ata_bmdma_setup,
367 .bmdma_start = ata_bmdma_start,
368 .bmdma_stop = hpt3x2n_bmdma_stop, 352 .bmdma_stop = hpt3x2n_bmdma_stop,
369 .bmdma_status = ata_bmdma_status,
370
371 .qc_prep = ata_qc_prep,
372 .qc_issue = hpt3x2n_qc_issue_prot, 353 .qc_issue = hpt3x2n_qc_issue_prot,
373 354
374 .data_xfer = ata_data_xfer, 355 .cable_detect = hpt3x2n_cable_detect,
375 356 .set_piomode = hpt3x2n_set_piomode,
376 .irq_handler = ata_interrupt, 357 .set_dmamode = hpt3x2n_set_dmamode,
377 .irq_clear = ata_bmdma_irq_clear, 358 .error_handler = hpt3x2n_error_handler,
378 .irq_on = ata_irq_on,
379
380 .port_start = ata_sff_port_start,
381}; 359};
382 360
383/** 361/**
diff --git a/drivers/ata/pata_hpt3x3.c b/drivers/ata/pata_hpt3x3.c
index 9837ab0181e8..8857d029ac2e 100644
--- a/drivers/ata/pata_hpt3x3.c
+++ b/drivers/ata/pata_hpt3x3.c
@@ -106,40 +106,13 @@ static struct scsi_host_template hpt3x3_sht = {
106}; 106};
107 107
108static struct ata_port_operations hpt3x3_port_ops = { 108static struct ata_port_operations hpt3x3_port_ops = {
109 .inherits = &ata_bmdma_port_ops,
110 .check_atapi_dma= hpt3x3_atapi_dma,
111 .cable_detect = ata_cable_40wire,
109 .set_piomode = hpt3x3_set_piomode, 112 .set_piomode = hpt3x3_set_piomode,
110#if defined(CONFIG_PATA_HPT3X3_DMA) 113#if defined(CONFIG_PATA_HPT3X3_DMA)
111 .set_dmamode = hpt3x3_set_dmamode, 114 .set_dmamode = hpt3x3_set_dmamode,
112#endif 115#endif
113 .mode_filter = ata_pci_default_filter,
114
115 .tf_load = ata_tf_load,
116 .tf_read = ata_tf_read,
117 .check_status = ata_check_status,
118 .exec_command = ata_exec_command,
119 .dev_select = ata_std_dev_select,
120
121 .freeze = ata_bmdma_freeze,
122 .thaw = ata_bmdma_thaw,
123 .error_handler = ata_bmdma_error_handler,
124 .post_internal_cmd = ata_bmdma_post_internal_cmd,
125 .cable_detect = ata_cable_40wire,
126
127 .bmdma_setup = ata_bmdma_setup,
128 .bmdma_start = ata_bmdma_start,
129 .bmdma_stop = ata_bmdma_stop,
130 .bmdma_status = ata_bmdma_status,
131 .check_atapi_dma= hpt3x3_atapi_dma,
132
133 .qc_prep = ata_qc_prep,
134 .qc_issue = ata_qc_issue_prot,
135
136 .data_xfer = ata_data_xfer,
137
138 .irq_handler = ata_interrupt,
139 .irq_clear = ata_bmdma_irq_clear,
140 .irq_on = ata_irq_on,
141
142 .port_start = ata_sff_port_start,
143}; 116};
144 117
145/** 118/**
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index 88a1c7ae0a4d..ff16b0eaa2c2 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -339,35 +339,19 @@ static void pata_icside_error_handler(struct ata_port *ap)
339} 339}
340 340
341static struct ata_port_operations pata_icside_port_ops = { 341static struct ata_port_operations pata_icside_port_ops = {
342 .set_dmamode = pata_icside_set_dmamode, 342 .inherits = &ata_sff_port_ops,
343
344 .tf_load = ata_tf_load,
345 .tf_read = ata_tf_read,
346 .exec_command = ata_exec_command,
347 .check_status = ata_check_status,
348 .dev_select = ata_std_dev_select,
349
350 .cable_detect = ata_cable_40wire,
351
352 .bmdma_setup = pata_icside_bmdma_setup,
353 .bmdma_start = pata_icside_bmdma_start,
354
355 .data_xfer = ata_data_xfer_noirq,
356
357 /* no need to build any PRD tables for DMA */ 343 /* no need to build any PRD tables for DMA */
358 .qc_prep = ata_noop_qc_prep, 344 .qc_prep = ata_noop_qc_prep,
359 .qc_issue = ata_qc_issue_prot, 345 .data_xfer = ata_data_xfer_noirq,
346 .bmdma_setup = pata_icside_bmdma_setup,
347 .bmdma_start = pata_icside_bmdma_start,
348 .bmdma_stop = pata_icside_bmdma_stop,
349 .bmdma_status = pata_icside_bmdma_status,
360 350
361 .freeze = ata_bmdma_freeze, 351 .cable_detect = ata_cable_40wire,
362 .thaw = ata_bmdma_thaw, 352 .set_dmamode = pata_icside_set_dmamode,
363 .error_handler = pata_icside_error_handler, 353 .error_handler = pata_icside_error_handler,
364 .post_internal_cmd = pata_icside_bmdma_stop, 354 .post_internal_cmd = pata_icside_bmdma_stop,
365
366 .irq_clear = ata_noop_irq_clear,
367 .irq_on = ata_irq_on,
368
369 .bmdma_stop = pata_icside_bmdma_stop,
370 .bmdma_status = pata_icside_bmdma_status,
371}; 355};
372 356
373static void __devinit 357static void __devinit
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c
index 91ca4d50db04..085913ec6f68 100644
--- a/drivers/ata/pata_isapnp.c
+++ b/drivers/ata/pata_isapnp.c
@@ -24,27 +24,8 @@ static struct scsi_host_template isapnp_sht = {
24}; 24};
25 25
26static struct ata_port_operations isapnp_port_ops = { 26static struct ata_port_operations isapnp_port_ops = {
27 .tf_load = ata_tf_load, 27 .inherits = &ata_sff_port_ops,
28 .tf_read = ata_tf_read,
29 .check_status = ata_check_status,
30 .exec_command = ata_exec_command,
31 .dev_select = ata_std_dev_select,
32
33 .freeze = ata_bmdma_freeze,
34 .thaw = ata_bmdma_thaw,
35 .error_handler = ata_bmdma_error_handler,
36 .post_internal_cmd = ata_bmdma_post_internal_cmd,
37 .cable_detect = ata_cable_40wire, 28 .cable_detect = ata_cable_40wire,
38
39 .qc_prep = ata_qc_prep,
40 .qc_issue = ata_qc_issue_prot,
41
42 .data_xfer = ata_data_xfer,
43
44 .irq_clear = ata_noop_irq_clear,
45 .irq_on = ata_irq_on,
46
47 .port_start = ata_sff_port_start,
48}; 29};
49 30
50/** 31/**
diff --git a/drivers/ata/pata_it8213.c b/drivers/ata/pata_it8213.c
index 678a05b304d8..9ce89522e764 100644
--- a/drivers/ata/pata_it8213.c
+++ b/drivers/ata/pata_it8213.c
@@ -246,36 +246,13 @@ static struct scsi_host_template it8213_sht = {
246 ATA_BMDMA_SHT(DRV_NAME), 246 ATA_BMDMA_SHT(DRV_NAME),
247}; 247};
248 248
249static const struct ata_port_operations it8213_ops = { 249
250static struct ata_port_operations it8213_ops = {
251 .inherits = &ata_bmdma_port_ops,
252 .cable_detect = it8213_cable_detect,
250 .set_piomode = it8213_set_piomode, 253 .set_piomode = it8213_set_piomode,
251 .set_dmamode = it8213_set_dmamode, 254 .set_dmamode = it8213_set_dmamode,
252 .mode_filter = ata_pci_default_filter,
253
254 .tf_load = ata_tf_load,
255 .tf_read = ata_tf_read,
256 .check_status = ata_check_status,
257 .exec_command = ata_exec_command,
258 .dev_select = ata_std_dev_select,
259
260 .freeze = ata_bmdma_freeze,
261 .thaw = ata_bmdma_thaw,
262 .error_handler = it8213_error_handler, 255 .error_handler = it8213_error_handler,
263 .post_internal_cmd = ata_bmdma_post_internal_cmd,
264 .cable_detect = it8213_cable_detect,
265
266 .bmdma_setup = ata_bmdma_setup,
267 .bmdma_start = ata_bmdma_start,
268 .bmdma_stop = ata_bmdma_stop,
269 .bmdma_status = ata_bmdma_status,
270 .qc_prep = ata_qc_prep,
271 .qc_issue = ata_qc_issue_prot,
272 .data_xfer = ata_data_xfer,
273
274 .irq_handler = ata_interrupt,
275 .irq_clear = ata_bmdma_irq_clear,
276 .irq_on = ata_irq_on,
277
278 .port_start = ata_sff_port_start,
279}; 256};
280 257
281 258
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 7d969c911731..669d224d30ca 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -636,71 +636,30 @@ static struct scsi_host_template it821x_sht = {
636}; 636};
637 637
638static struct ata_port_operations it821x_smart_port_ops = { 638static struct ata_port_operations it821x_smart_port_ops = {
639 .set_mode = it821x_smart_set_mode, 639 .inherits = &ata_bmdma_port_ops,
640 .tf_load = ata_tf_load,
641 .tf_read = ata_tf_read,
642 .mode_filter = ata_pci_default_filter,
643 640
644 .check_status = ata_check_status,
645 .check_atapi_dma= it821x_check_atapi_dma, 641 .check_atapi_dma= it821x_check_atapi_dma,
646 .exec_command = ata_exec_command,
647 .dev_select = ata_std_dev_select,
648 .dev_config = it821x_dev_config,
649
650 .freeze = ata_bmdma_freeze,
651 .thaw = ata_bmdma_thaw,
652 .error_handler = ata_bmdma_error_handler,
653 .post_internal_cmd = ata_bmdma_post_internal_cmd,
654 .cable_detect = it821x_ident_hack,
655
656 .bmdma_setup = ata_bmdma_setup,
657 .bmdma_start = ata_bmdma_start,
658 .bmdma_stop = ata_bmdma_stop,
659 .bmdma_status = ata_bmdma_status,
660
661 .qc_prep = ata_qc_prep,
662 .qc_issue = it821x_smart_qc_issue_prot, 642 .qc_issue = it821x_smart_qc_issue_prot,
663 643
664 .data_xfer = ata_data_xfer, 644 .cable_detect = it821x_ident_hack,
665 645 .set_mode = it821x_smart_set_mode,
666 .irq_handler = ata_interrupt, 646 .dev_config = it821x_dev_config,
667 .irq_clear = ata_bmdma_irq_clear,
668 .irq_on = ata_irq_on,
669 647
670 .port_start = it821x_port_start, 648 .port_start = it821x_port_start,
671}; 649};
672 650
673static struct ata_port_operations it821x_passthru_port_ops = { 651static struct ata_port_operations it821x_passthru_port_ops = {
674 .set_piomode = it821x_passthru_set_piomode, 652 .inherits = &ata_bmdma_port_ops,
675 .set_dmamode = it821x_passthru_set_dmamode,
676 .mode_filter = ata_pci_default_filter,
677 653
678 .tf_load = ata_tf_load,
679 .tf_read = ata_tf_read,
680 .check_status = ata_check_status,
681 .exec_command = ata_exec_command,
682 .check_atapi_dma= it821x_check_atapi_dma, 654 .check_atapi_dma= it821x_check_atapi_dma,
683 .dev_select = it821x_passthru_dev_select, 655 .dev_select = it821x_passthru_dev_select,
684
685 .freeze = ata_bmdma_freeze,
686 .thaw = ata_bmdma_thaw,
687 .error_handler = ata_bmdma_error_handler,
688 .post_internal_cmd = ata_bmdma_post_internal_cmd,
689 .cable_detect = ata_cable_unknown,
690
691 .bmdma_setup = ata_bmdma_setup,
692 .bmdma_start = it821x_passthru_bmdma_start, 656 .bmdma_start = it821x_passthru_bmdma_start,
693 .bmdma_stop = it821x_passthru_bmdma_stop, 657 .bmdma_stop = it821x_passthru_bmdma_stop,
694 .bmdma_status = ata_bmdma_status,
695
696 .qc_prep = ata_qc_prep,
697 .qc_issue = it821x_passthru_qc_issue_prot, 658 .qc_issue = it821x_passthru_qc_issue_prot,
698 659
699 .data_xfer = ata_data_xfer, 660 .cable_detect = ata_cable_unknown,
700 661 .set_piomode = it821x_passthru_set_piomode,
701 .irq_clear = ata_bmdma_irq_clear, 662 .set_dmamode = it821x_passthru_set_dmamode,
702 .irq_handler = ata_interrupt,
703 .irq_on = ata_irq_on,
704 663
705 .port_start = it821x_port_start, 664 .port_start = it821x_port_start,
706}; 665};
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index b7e8e825a869..d02629aa20da 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -92,29 +92,10 @@ static struct scsi_host_template ixp4xx_sht = {
92}; 92};
93 93
94static struct ata_port_operations ixp4xx_port_ops = { 94static struct ata_port_operations ixp4xx_port_ops = {
95 .set_mode = ixp4xx_set_mode, 95 .inherits = &ata_sff_port_ops,
96
97 .tf_load = ata_tf_load,
98 .tf_read = ata_tf_read,
99 .exec_command = ata_exec_command,
100 .check_status = ata_check_status,
101 .dev_select = ata_std_dev_select,
102
103 .freeze = ata_bmdma_freeze,
104 .thaw = ata_bmdma_thaw,
105 .error_handler = ata_bmdma_error_handler,
106 .post_internal_cmd = ata_bmdma_post_internal_cmd,
107
108 .qc_prep = ata_qc_prep,
109 .qc_issue = ata_qc_issue_prot,
110 .data_xfer = ixp4xx_mmio_data_xfer, 96 .data_xfer = ixp4xx_mmio_data_xfer,
111 .cable_detect = ata_cable_40wire, 97 .cable_detect = ata_cable_40wire,
112 98 .set_mode = ixp4xx_set_mode,
113 .irq_handler = ata_interrupt,
114 .irq_clear = ata_noop_irq_clear,
115 .irq_on = ata_irq_on,
116
117 .port_start = ata_sff_port_start,
118}; 99};
119 100
120static void ixp4xx_setup_port(struct ata_port *ap, 101static void ixp4xx_setup_port(struct ata_port *ap,
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index 69781af7b1bb..61ff5c6b4568 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -125,36 +125,9 @@ static struct scsi_host_template jmicron_sht = {
125 ATA_BMDMA_SHT(DRV_NAME), 125 ATA_BMDMA_SHT(DRV_NAME),
126}; 126};
127 127
128static const struct ata_port_operations jmicron_ops = { 128static struct ata_port_operations jmicron_ops = {
129 /* Task file is PCI ATA format, use helpers */ 129 .inherits = &ata_bmdma_port_ops,
130 .tf_load = ata_tf_load,
131 .tf_read = ata_tf_read,
132 .check_status = ata_check_status,
133 .exec_command = ata_exec_command,
134 .dev_select = ata_std_dev_select,
135
136 .mode_filter = ata_pci_default_filter,
137 .freeze = ata_bmdma_freeze,
138 .thaw = ata_bmdma_thaw,
139 .error_handler = jmicron_error_handler, 130 .error_handler = jmicron_error_handler,
140 .post_internal_cmd = ata_bmdma_post_internal_cmd,
141
142 /* BMDMA handling is PCI ATA format, use helpers */
143 .bmdma_setup = ata_bmdma_setup,
144 .bmdma_start = ata_bmdma_start,
145 .bmdma_stop = ata_bmdma_stop,
146 .bmdma_status = ata_bmdma_status,
147 .qc_prep = ata_qc_prep,
148 .qc_issue = ata_qc_issue_prot,
149 .data_xfer = ata_data_xfer,
150
151 /* IRQ-related hooks */
152 .irq_handler = ata_interrupt,
153 .irq_clear = ata_bmdma_irq_clear,
154 .irq_on = ata_irq_on,
155
156 /* Generic PATA PCI ATA helpers */
157 .port_start = ata_sff_port_start,
158}; 131};
159 132
160 133
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 5329b954c5f2..2474068596f4 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -211,6 +211,11 @@ static struct scsi_host_template legacy_sht = {
211 ATA_PIO_SHT(DRV_NAME), 211 ATA_PIO_SHT(DRV_NAME),
212}; 212};
213 213
214static const struct ata_port_operations legacy_base_port_ops = {
215 .inherits = &ata_sff_port_ops,
216 .cable_detect = ata_cable_40wire,
217};
218
214/* 219/*
215 * These ops are used if the user indicates the hardware 220 * These ops are used if the user indicates the hardware
216 * snoops the commands to decide on the mode and handles the 221 * snoops the commands to decide on the mode and handles the
@@ -220,55 +225,14 @@ static struct scsi_host_template legacy_sht = {
220 */ 225 */
221 226
222static struct ata_port_operations simple_port_ops = { 227static struct ata_port_operations simple_port_ops = {
223 .tf_load = ata_tf_load, 228 .inherits = &legacy_base_port_ops,
224 .tf_read = ata_tf_read,
225 .check_status = ata_check_status,
226 .exec_command = ata_exec_command,
227 .dev_select = ata_std_dev_select,
228
229 .freeze = ata_bmdma_freeze,
230 .thaw = ata_bmdma_thaw,
231 .error_handler = ata_bmdma_error_handler,
232 .post_internal_cmd = ata_bmdma_post_internal_cmd,
233 .cable_detect = ata_cable_40wire,
234
235 .qc_prep = ata_qc_prep,
236 .qc_issue = ata_qc_issue_prot,
237
238 .data_xfer = ata_data_xfer_noirq, 229 .data_xfer = ata_data_xfer_noirq,
239
240 .irq_handler = ata_interrupt,
241 .irq_clear = ata_noop_irq_clear,
242 .irq_on = ata_irq_on,
243
244 .port_start = ata_sff_port_start,
245}; 230};
246 231
247static struct ata_port_operations legacy_port_ops = { 232static struct ata_port_operations legacy_port_ops = {
248 .set_mode = legacy_set_mode, 233 .inherits = &legacy_base_port_ops,
249
250 .tf_load = ata_tf_load,
251 .tf_read = ata_tf_read,
252 .check_status = ata_check_status,
253 .exec_command = ata_exec_command,
254 .dev_select = ata_std_dev_select,
255 .cable_detect = ata_cable_40wire,
256
257 .freeze = ata_bmdma_freeze,
258 .thaw = ata_bmdma_thaw,
259 .error_handler = ata_bmdma_error_handler,
260 .post_internal_cmd = ata_bmdma_post_internal_cmd,
261
262 .qc_prep = ata_qc_prep,
263 .qc_issue = ata_qc_issue_prot,
264
265 .data_xfer = ata_data_xfer_noirq, 234 .data_xfer = ata_data_xfer_noirq,
266 235 .set_mode = legacy_set_mode,
267 .irq_handler = ata_interrupt,
268 .irq_clear = ata_noop_irq_clear,
269 .irq_on = ata_irq_on,
270
271 .port_start = ata_sff_port_start,
272}; 236};
273 237
274/* 238/*
@@ -359,30 +323,9 @@ static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
359} 323}
360 324
361static struct ata_port_operations pdc20230_port_ops = { 325static struct ata_port_operations pdc20230_port_ops = {
326 .inherits = &legacy_base_port_ops,
362 .set_piomode = pdc20230_set_piomode, 327 .set_piomode = pdc20230_set_piomode,
363
364 .tf_load = ata_tf_load,
365 .tf_read = ata_tf_read,
366 .check_status = ata_check_status,
367 .exec_command = ata_exec_command,
368 .dev_select = ata_std_dev_select,
369
370 .freeze = ata_bmdma_freeze,
371 .thaw = ata_bmdma_thaw,
372 .error_handler = ata_bmdma_error_handler,
373 .post_internal_cmd = ata_bmdma_post_internal_cmd,
374 .cable_detect = ata_cable_40wire,
375
376 .qc_prep = ata_qc_prep,
377 .qc_issue = ata_qc_issue_prot,
378
379 .data_xfer = pdc_data_xfer_vlb, 328 .data_xfer = pdc_data_xfer_vlb,
380
381 .irq_handler = ata_interrupt,
382 .irq_clear = ata_noop_irq_clear,
383 .irq_on = ata_irq_on,
384
385 .port_start = ata_sff_port_start,
386}; 329};
387 330
388/* 331/*
@@ -413,30 +356,8 @@ static void ht6560a_set_piomode(struct ata_port *ap, struct ata_device *adev)
413} 356}
414 357
415static struct ata_port_operations ht6560a_port_ops = { 358static struct ata_port_operations ht6560a_port_ops = {
359 .inherits = &legacy_base_port_ops,
416 .set_piomode = ht6560a_set_piomode, 360 .set_piomode = ht6560a_set_piomode,
417
418 .tf_load = ata_tf_load,
419 .tf_read = ata_tf_read,
420 .check_status = ata_check_status,
421 .exec_command = ata_exec_command,
422 .dev_select = ata_std_dev_select,
423
424 .freeze = ata_bmdma_freeze,
425 .thaw = ata_bmdma_thaw,
426 .error_handler = ata_bmdma_error_handler,
427 .post_internal_cmd = ata_bmdma_post_internal_cmd,
428 .cable_detect = ata_cable_40wire,
429
430 .qc_prep = ata_qc_prep,
431 .qc_issue = ata_qc_issue_prot,
432
433 .data_xfer = ata_data_xfer, /* Check vlb/noirq */
434
435 .irq_handler = ata_interrupt,
436 .irq_clear = ata_noop_irq_clear,
437 .irq_on = ata_irq_on,
438
439 .port_start = ata_sff_port_start,
440}; 361};
441 362
442/* 363/*
@@ -478,30 +399,8 @@ static void ht6560b_set_piomode(struct ata_port *ap, struct ata_device *adev)
478} 399}
479 400
480static struct ata_port_operations ht6560b_port_ops = { 401static struct ata_port_operations ht6560b_port_ops = {
402 .inherits = &legacy_base_port_ops,
481 .set_piomode = ht6560b_set_piomode, 403 .set_piomode = ht6560b_set_piomode,
482
483 .tf_load = ata_tf_load,
484 .tf_read = ata_tf_read,
485 .check_status = ata_check_status,
486 .exec_command = ata_exec_command,
487 .dev_select = ata_std_dev_select,
488
489 .freeze = ata_bmdma_freeze,
490 .thaw = ata_bmdma_thaw,
491 .error_handler = ata_bmdma_error_handler,
492 .post_internal_cmd = ata_bmdma_post_internal_cmd,
493 .cable_detect = ata_cable_40wire,
494
495 .qc_prep = ata_qc_prep,
496 .qc_issue = ata_qc_issue_prot,
497
498 .data_xfer = ata_data_xfer, /* FIXME: Check 32bit and noirq */
499
500 .irq_handler = ata_interrupt,
501 .irq_clear = ata_noop_irq_clear,
502 .irq_on = ata_irq_on,
503
504 .port_start = ata_sff_port_start,
505}; 404};
506 405
507/* 406/*
@@ -599,30 +498,8 @@ static void opti82c611a_set_piomode(struct ata_port *ap,
599 498
600 499
601static struct ata_port_operations opti82c611a_port_ops = { 500static struct ata_port_operations opti82c611a_port_ops = {
501 .inherits = &legacy_base_port_ops,
602 .set_piomode = opti82c611a_set_piomode, 502 .set_piomode = opti82c611a_set_piomode,
603
604 .tf_load = ata_tf_load,
605 .tf_read = ata_tf_read,
606 .check_status = ata_check_status,
607 .exec_command = ata_exec_command,
608 .dev_select = ata_std_dev_select,
609
610 .freeze = ata_bmdma_freeze,
611 .thaw = ata_bmdma_thaw,
612 .error_handler = ata_bmdma_error_handler,
613 .post_internal_cmd = ata_bmdma_post_internal_cmd,
614 .cable_detect = ata_cable_40wire,
615
616 .qc_prep = ata_qc_prep,
617 .qc_issue = ata_qc_issue_prot,
618
619 .data_xfer = ata_data_xfer,
620
621 .irq_handler = ata_interrupt,
622 .irq_clear = ata_noop_irq_clear,
623 .irq_on = ata_irq_on,
624
625 .port_start = ata_sff_port_start,
626}; 503};
627 504
628/* 505/*
@@ -731,30 +608,9 @@ static unsigned int opti82c46x_qc_issue_prot(struct ata_queued_cmd *qc)
731} 608}
732 609
733static struct ata_port_operations opti82c46x_port_ops = { 610static struct ata_port_operations opti82c46x_port_ops = {
611 .inherits = &legacy_base_port_ops,
734 .set_piomode = opti82c46x_set_piomode, 612 .set_piomode = opti82c46x_set_piomode,
735
736 .tf_load = ata_tf_load,
737 .tf_read = ata_tf_read,
738 .check_status = ata_check_status,
739 .exec_command = ata_exec_command,
740 .dev_select = ata_std_dev_select,
741
742 .freeze = ata_bmdma_freeze,
743 .thaw = ata_bmdma_thaw,
744 .error_handler = ata_bmdma_error_handler,
745 .post_internal_cmd = ata_bmdma_post_internal_cmd,
746 .cable_detect = ata_cable_40wire,
747
748 .qc_prep = ata_qc_prep,
749 .qc_issue = opti82c46x_qc_issue_prot, 613 .qc_issue = opti82c46x_qc_issue_prot,
750
751 .data_xfer = ata_data_xfer,
752
753 .irq_handler = ata_interrupt,
754 .irq_clear = ata_noop_irq_clear,
755 .irq_on = ata_irq_on,
756
757 .port_start = ata_sff_port_start,
758}; 614};
759 615
760static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev) 616static void qdi6500_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -916,84 +772,22 @@ static int qdi_port(struct platform_device *dev,
916} 772}
917 773
918static struct ata_port_operations qdi6500_port_ops = { 774static struct ata_port_operations qdi6500_port_ops = {
775 .inherits = &legacy_base_port_ops,
919 .set_piomode = qdi6500_set_piomode, 776 .set_piomode = qdi6500_set_piomode,
920
921 .tf_load = ata_tf_load,
922 .tf_read = ata_tf_read,
923 .check_status = ata_check_status,
924 .exec_command = ata_exec_command,
925 .dev_select = ata_std_dev_select,
926
927 .freeze = ata_bmdma_freeze,
928 .thaw = ata_bmdma_thaw,
929 .error_handler = ata_bmdma_error_handler,
930 .post_internal_cmd = ata_bmdma_post_internal_cmd,
931 .cable_detect = ata_cable_40wire,
932
933 .qc_prep = ata_qc_prep,
934 .qc_issue = qdi_qc_issue_prot, 777 .qc_issue = qdi_qc_issue_prot,
935
936 .data_xfer = vlb32_data_xfer, 778 .data_xfer = vlb32_data_xfer,
937
938 .irq_handler = ata_interrupt,
939 .irq_clear = ata_noop_irq_clear,
940 .irq_on = ata_irq_on,
941
942 .port_start = ata_sff_port_start,
943}; 779};
944 780
945static struct ata_port_operations qdi6580_port_ops = { 781static struct ata_port_operations qdi6580_port_ops = {
782 .inherits = &legacy_base_port_ops,
946 .set_piomode = qdi6580_set_piomode, 783 .set_piomode = qdi6580_set_piomode,
947
948 .tf_load = ata_tf_load,
949 .tf_read = ata_tf_read,
950 .check_status = ata_check_status,
951 .exec_command = ata_exec_command,
952 .dev_select = ata_std_dev_select,
953
954 .freeze = ata_bmdma_freeze,
955 .thaw = ata_bmdma_thaw,
956 .error_handler = ata_bmdma_error_handler,
957 .post_internal_cmd = ata_bmdma_post_internal_cmd,
958 .cable_detect = ata_cable_40wire,
959
960 .qc_prep = ata_qc_prep,
961 .qc_issue = ata_qc_issue_prot,
962
963 .data_xfer = vlb32_data_xfer, 784 .data_xfer = vlb32_data_xfer,
964
965 .irq_handler = ata_interrupt,
966 .irq_clear = ata_noop_irq_clear,
967 .irq_on = ata_irq_on,
968
969 .port_start = ata_sff_port_start,
970}; 785};
971 786
972static struct ata_port_operations qdi6580dp_port_ops = { 787static struct ata_port_operations qdi6580dp_port_ops = {
788 .inherits = &legacy_base_port_ops,
973 .set_piomode = qdi6580dp_set_piomode, 789 .set_piomode = qdi6580dp_set_piomode,
974
975 .tf_load = ata_tf_load,
976 .tf_read = ata_tf_read,
977 .check_status = ata_check_status,
978 .exec_command = ata_exec_command,
979 .dev_select = ata_std_dev_select,
980
981 .freeze = ata_bmdma_freeze,
982 .thaw = ata_bmdma_thaw,
983 .error_handler = ata_bmdma_error_handler,
984 .post_internal_cmd = ata_bmdma_post_internal_cmd,
985 .cable_detect = ata_cable_40wire,
986
987 .qc_prep = ata_qc_prep,
988 .qc_issue = qdi_qc_issue_prot,
989
990 .data_xfer = vlb32_data_xfer, 790 .data_xfer = vlb32_data_xfer,
991
992 .irq_handler = ata_interrupt,
993 .irq_clear = ata_noop_irq_clear,
994 .irq_on = ata_irq_on,
995
996 .port_start = ata_sff_port_start,
997}; 791};
998 792
999static DEFINE_SPINLOCK(winbond_lock); 793static DEFINE_SPINLOCK(winbond_lock);
@@ -1062,29 +856,9 @@ static int winbond_port(struct platform_device *dev,
1062} 856}
1063 857
1064static struct ata_port_operations winbond_port_ops = { 858static struct ata_port_operations winbond_port_ops = {
859 .inherits = &legacy_base_port_ops,
1065 .set_piomode = winbond_set_piomode, 860 .set_piomode = winbond_set_piomode,
1066
1067 .tf_load = ata_tf_load,
1068 .tf_read = ata_tf_read,
1069 .check_status = ata_check_status,
1070 .exec_command = ata_exec_command,
1071 .dev_select = ata_std_dev_select,
1072
1073 .freeze = ata_bmdma_freeze,
1074 .thaw = ata_bmdma_thaw,
1075 .error_handler = ata_bmdma_error_handler,
1076 .post_internal_cmd = ata_bmdma_post_internal_cmd,
1077 .cable_detect = ata_cable_40wire,
1078
1079 .qc_prep = ata_qc_prep,
1080 .qc_issue = ata_qc_issue_prot,
1081
1082 .data_xfer = vlb32_data_xfer, 861 .data_xfer = vlb32_data_xfer,
1083
1084 .irq_clear = ata_noop_irq_clear,
1085 .irq_on = ata_irq_on,
1086
1087 .port_start = ata_sff_port_start,
1088}; 862};
1089 863
1090static struct legacy_controller controllers[] = { 864static struct legacy_controller controllers[] = {
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index 9de6e429d0d1..286310fc5910 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -95,37 +95,10 @@ static struct scsi_host_template marvell_sht = {
95 ATA_BMDMA_SHT(DRV_NAME), 95 ATA_BMDMA_SHT(DRV_NAME),
96}; 96};
97 97
98static const struct ata_port_operations marvell_ops = { 98static struct ata_port_operations marvell_ops = {
99 /* Task file is PCI ATA format, use helpers */ 99 .inherits = &ata_bmdma_port_ops,
100 .tf_load = ata_tf_load,
101 .tf_read = ata_tf_read,
102 .check_status = ata_check_status,
103 .exec_command = ata_exec_command,
104 .dev_select = ata_std_dev_select,
105
106 .mode_filter = ata_pci_default_filter,
107 .freeze = ata_bmdma_freeze,
108 .thaw = ata_bmdma_thaw,
109 .error_handler = marvell_error_handler,
110 .post_internal_cmd = ata_bmdma_post_internal_cmd,
111 .cable_detect = marvell_cable_detect, 100 .cable_detect = marvell_cable_detect,
112 101 .error_handler = marvell_error_handler,
113 /* BMDMA handling is PCI ATA format, use helpers */
114 .bmdma_setup = ata_bmdma_setup,
115 .bmdma_start = ata_bmdma_start,
116 .bmdma_stop = ata_bmdma_stop,
117 .bmdma_status = ata_bmdma_status,
118 .qc_prep = ata_qc_prep,
119 .qc_issue = ata_qc_issue_prot,
120 .data_xfer = ata_data_xfer,
121
122 /* Timeout handling */
123 .irq_handler = ata_interrupt,
124 .irq_clear = ata_bmdma_irq_clear,
125 .irq_on = ata_irq_on,
126
127 /* Generic PATA PCI ATA helpers */
128 .port_start = ata_sff_port_start,
129}; 102};
130 103
131 104
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 4117b618a9d9..ac7c0822b1a7 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -269,22 +269,12 @@ static struct scsi_host_template mpc52xx_ata_sht = {
269}; 269};
270 270
271static struct ata_port_operations mpc52xx_ata_port_ops = { 271static struct ata_port_operations mpc52xx_ata_port_ops = {
272 .set_piomode = mpc52xx_ata_set_piomode, 272 .inherits = &ata_sff_port_ops,
273 .dev_select = mpc52xx_ata_dev_select, 273 .dev_select = mpc52xx_ata_dev_select,
274 .tf_load = ata_tf_load,
275 .tf_read = ata_tf_read,
276 .check_status = ata_check_status,
277 .exec_command = ata_exec_command,
278 .freeze = ata_bmdma_freeze,
279 .thaw = ata_bmdma_thaw,
280 .error_handler = mpc52xx_ata_error_handler,
281 .cable_detect = ata_cable_40wire, 274 .cable_detect = ata_cable_40wire,
282 .qc_prep = ata_qc_prep, 275 .set_piomode = mpc52xx_ata_set_piomode,
283 .qc_issue = ata_qc_issue_prot, 276 .error_handler = mpc52xx_ata_error_handler,
284 .data_xfer = ata_data_xfer, 277 .post_internal_cmd = ATA_OP_NULL,
285 .irq_clear = ata_noop_irq_clear,
286 .irq_on = ata_irq_on,
287 .port_start = ata_sff_port_start,
288}; 278};
289 279
290static int __devinit 280static int __devinit
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c
index e8e6837110b4..dab54f8a272d 100644
--- a/drivers/ata/pata_mpiix.c
+++ b/drivers/ata/pata_mpiix.c
@@ -155,28 +155,11 @@ static struct scsi_host_template mpiix_sht = {
155}; 155};
156 156
157static struct ata_port_operations mpiix_port_ops = { 157static struct ata_port_operations mpiix_port_ops = {
158 .inherits = &ata_sff_port_ops,
159 .qc_issue = mpiix_qc_issue_prot,
160 .cable_detect = ata_cable_40wire,
158 .set_piomode = mpiix_set_piomode, 161 .set_piomode = mpiix_set_piomode,
159
160 .tf_load = ata_tf_load,
161 .tf_read = ata_tf_read,
162 .check_status = ata_check_status,
163 .exec_command = ata_exec_command,
164 .dev_select = ata_std_dev_select,
165
166 .freeze = ata_bmdma_freeze,
167 .thaw = ata_bmdma_thaw,
168 .error_handler = mpiix_error_handler, 162 .error_handler = mpiix_error_handler,
169 .post_internal_cmd = ata_bmdma_post_internal_cmd,
170 .cable_detect = ata_cable_40wire,
171
172 .qc_prep = ata_qc_prep,
173 .qc_issue = mpiix_qc_issue_prot,
174 .data_xfer = ata_data_xfer,
175
176 .irq_clear = ata_noop_irq_clear,
177 .irq_on = ata_irq_on,
178
179 .port_start = ata_sff_port_start,
180}; 163};
181 164
182static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id) 165static int mpiix_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_netcell.c b/drivers/ata/pata_netcell.c
index 11f200a2a156..65389d1837b3 100644
--- a/drivers/ata/pata_netcell.c
+++ b/drivers/ata/pata_netcell.c
@@ -24,37 +24,9 @@ static struct scsi_host_template netcell_sht = {
24 ATA_BMDMA_SHT(DRV_NAME), 24 ATA_BMDMA_SHT(DRV_NAME),
25}; 25};
26 26
27static const struct ata_port_operations netcell_ops = { 27static struct ata_port_operations netcell_ops = {
28 /* Task file is PCI ATA format, use helpers */ 28 .inherits = &ata_bmdma_port_ops,
29 .tf_load = ata_tf_load,
30 .tf_read = ata_tf_read,
31 .check_status = ata_check_status,
32 .exec_command = ata_exec_command,
33 .dev_select = ata_std_dev_select,
34
35 .mode_filter = ata_pci_default_filter,
36 .freeze = ata_bmdma_freeze,
37 .thaw = ata_bmdma_thaw,
38 .error_handler = ata_bmdma_error_handler,
39 .post_internal_cmd = ata_bmdma_post_internal_cmd,
40 .cable_detect = ata_cable_80wire, 29 .cable_detect = ata_cable_80wire,
41
42 /* BMDMA handling is PCI ATA format, use helpers */
43 .bmdma_setup = ata_bmdma_setup,
44 .bmdma_start = ata_bmdma_start,
45 .bmdma_stop = ata_bmdma_stop,
46 .bmdma_status = ata_bmdma_status,
47 .qc_prep = ata_qc_prep,
48 .qc_issue = ata_qc_issue_prot,
49 .data_xfer = ata_data_xfer,
50
51 /* IRQ-related hooks */
52 .irq_handler = ata_interrupt,
53 .irq_clear = ata_bmdma_irq_clear,
54 .irq_on = ata_irq_on,
55
56 /* Generic PATA PCI ATA helpers */
57 .port_start = ata_sff_port_start,
58}; 30};
59 31
60 32
diff --git a/drivers/ata/pata_ninja32.c b/drivers/ata/pata_ninja32.c
index ce3b07cab8bc..8213d081f313 100644
--- a/drivers/ata/pata_ninja32.c
+++ b/drivers/ata/pata_ninja32.c
@@ -83,36 +83,10 @@ static struct scsi_host_template ninja32_sht = {
83}; 83};
84 84
85static struct ata_port_operations ninja32_port_ops = { 85static struct ata_port_operations ninja32_port_ops = {
86 .set_piomode = ninja32_set_piomode, 86 .inherits = &ata_bmdma_port_ops,
87 .mode_filter = ata_pci_default_filter,
88
89 .tf_load = ata_tf_load,
90 .tf_read = ata_tf_read,
91 .check_status = ata_check_status,
92 .exec_command = ata_exec_command,
93 .dev_select = ninja32_dev_select, 87 .dev_select = ninja32_dev_select,
94
95 .freeze = ata_bmdma_freeze,
96 .thaw = ata_bmdma_thaw,
97 .error_handler = ata_bmdma_error_handler,
98 .post_internal_cmd = ata_bmdma_post_internal_cmd,
99 .cable_detect = ata_cable_40wire, 88 .cable_detect = ata_cable_40wire,
100 89 .set_piomode = ninja32_set_piomode,
101 .bmdma_setup = ata_bmdma_setup,
102 .bmdma_start = ata_bmdma_start,
103 .bmdma_stop = ata_bmdma_stop,
104 .bmdma_status = ata_bmdma_status,
105
106 .qc_prep = ata_qc_prep,
107 .qc_issue = ata_qc_issue_prot,
108
109 .data_xfer = ata_data_xfer,
110
111 .irq_handler = ata_interrupt,
112 .irq_clear = ata_bmdma_irq_clear,
113 .irq_on = ata_irq_on,
114
115 .port_start = ata_sff_port_start,
116}; 90};
117 91
118static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) 92static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_ns87410.c b/drivers/ata/pata_ns87410.c
index d2f85f107d15..5b1982fa0be1 100644
--- a/drivers/ata/pata_ns87410.c
+++ b/drivers/ata/pata_ns87410.c
@@ -148,30 +148,11 @@ static struct scsi_host_template ns87410_sht = {
148}; 148};
149 149
150static struct ata_port_operations ns87410_port_ops = { 150static struct ata_port_operations ns87410_port_ops = {
151 .inherits = &ata_sff_port_ops,
152 .qc_issue = ns87410_qc_issue_prot,
153 .cable_detect = ata_cable_40wire,
151 .set_piomode = ns87410_set_piomode, 154 .set_piomode = ns87410_set_piomode,
152
153 .tf_load = ata_tf_load,
154 .tf_read = ata_tf_read,
155 .check_status = ata_check_status,
156 .exec_command = ata_exec_command,
157 .dev_select = ata_std_dev_select,
158
159 .freeze = ata_bmdma_freeze,
160 .thaw = ata_bmdma_thaw,
161 .error_handler = ns87410_error_handler, 155 .error_handler = ns87410_error_handler,
162 .post_internal_cmd = ata_bmdma_post_internal_cmd,
163 .cable_detect = ata_cable_40wire,
164
165 .qc_prep = ata_qc_prep,
166 .qc_issue = ns87410_qc_issue_prot,
167
168 .data_xfer = ata_data_xfer,
169
170 .irq_handler = ata_interrupt,
171 .irq_clear = ata_noop_irq_clear,
172 .irq_on = ata_irq_on,
173
174 .port_start = ata_sff_port_start,
175}; 156};
176 157
177static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id) 158static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_ns87415.c b/drivers/ata/pata_ns87415.c
index 78d634423cbf..38d86a262dbb 100644
--- a/drivers/ata/pata_ns87415.c
+++ b/drivers/ata/pata_ns87415.c
@@ -297,73 +297,29 @@ static u8 ns87560_bmdma_status(struct ata_port *ap)
297{ 297{
298 return ns87560_read_buggy(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); 298 return ns87560_read_buggy(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS);
299} 299}
300#endif /* 87560 SuperIO Support */
300 301
301static const struct ata_port_operations ns87560_pata_ops = { 302static struct ata_port_operations ns87415_pata_ops = {
302 .set_piomode = ns87415_set_piomode, 303 .inherits = &ata_bmdma_port_ops,
303 .mode_filter = ata_pci_default_filter,
304 304
305 .tf_load = ata_tf_load,
306 .tf_read = ns87560_tf_read,
307 .check_status = ns87560_check_status,
308 .check_atapi_dma = ns87415_check_atapi_dma, 305 .check_atapi_dma = ns87415_check_atapi_dma,
309 .exec_command = ata_exec_command,
310 .dev_select = ata_std_dev_select,
311
312 .freeze = ata_bmdma_freeze,
313 .thaw = ata_bmdma_thaw,
314 .error_handler = ata_bmdma_error_handler,
315 .post_internal_cmd = ata_bmdma_post_internal_cmd,
316 .cable_detect = ata_cable_40wire,
317
318 .bmdma_setup = ns87415_bmdma_setup, 306 .bmdma_setup = ns87415_bmdma_setup,
319 .bmdma_start = ns87415_bmdma_start, 307 .bmdma_start = ns87415_bmdma_start,
320 .bmdma_stop = ns87415_bmdma_stop, 308 .bmdma_stop = ns87415_bmdma_stop,
321 .bmdma_status = ns87560_bmdma_status,
322 .qc_prep = ata_qc_prep,
323 .qc_issue = ata_qc_issue_prot,
324 .data_xfer = ata_data_xfer,
325
326 .irq_handler = ata_interrupt,
327 .irq_clear = ns87415_bmdma_irq_clear, 309 .irq_clear = ns87415_bmdma_irq_clear,
328 .irq_on = ata_irq_on,
329
330 .port_start = ata_sff_port_start,
331};
332
333#endif /* 87560 SuperIO Support */
334
335
336static const struct ata_port_operations ns87415_pata_ops = {
337 .set_piomode = ns87415_set_piomode,
338 .mode_filter = ata_pci_default_filter,
339 310
340 .tf_load = ata_tf_load,
341 .tf_read = ata_tf_read,
342 .check_status = ata_check_status,
343 .check_atapi_dma = ns87415_check_atapi_dma,
344 .exec_command = ata_exec_command,
345 .dev_select = ata_std_dev_select,
346
347 .freeze = ata_bmdma_freeze,
348 .thaw = ata_bmdma_thaw,
349 .error_handler = ata_bmdma_error_handler,
350 .post_internal_cmd = ata_bmdma_post_internal_cmd,
351 .cable_detect = ata_cable_40wire, 311 .cable_detect = ata_cable_40wire,
312 .set_piomode = ns87415_set_piomode,
313};
352 314
353 .bmdma_setup = ns87415_bmdma_setup, 315#if defined(CONFIG_SUPERIO)
354 .bmdma_start = ns87415_bmdma_start, 316static struct ata_port_operations ns87560_pata_ops = {
355 .bmdma_stop = ns87415_bmdma_stop, 317 .inherits = &ns87415_pata_ops,
356 .bmdma_status = ata_bmdma_status, 318 .tf_read = ns87560_tf_read,
357 .qc_prep = ata_qc_prep, 319 .check_status = ns87560_check_status,
358 .qc_issue = ata_qc_issue_prot, 320 .bmdma_status = ns87560_bmdma_status,
359 .data_xfer = ata_data_xfer,
360
361 .irq_handler = ata_interrupt,
362 .irq_clear = ns87415_bmdma_irq_clear,
363 .irq_on = ata_irq_on,
364
365 .port_start = ata_sff_port_start,
366}; 321};
322#endif
367 323
368static struct scsi_host_template ns87415_sht = { 324static struct scsi_host_template ns87415_sht = {
369 ATA_BMDMA_SHT(DRV_NAME), 325 ATA_BMDMA_SHT(DRV_NAME),
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c
index 45f9b3eb5b45..f6062b37310d 100644
--- a/drivers/ata/pata_oldpiix.c
+++ b/drivers/ata/pata_oldpiix.c
@@ -223,36 +223,13 @@ static struct scsi_host_template oldpiix_sht = {
223 ATA_BMDMA_SHT(DRV_NAME), 223 ATA_BMDMA_SHT(DRV_NAME),
224}; 224};
225 225
226static const struct ata_port_operations oldpiix_pata_ops = { 226static struct ata_port_operations oldpiix_pata_ops = {
227 .inherits = &ata_bmdma_port_ops,
228 .qc_issue = oldpiix_qc_issue_prot,
229 .cable_detect = ata_cable_40wire,
227 .set_piomode = oldpiix_set_piomode, 230 .set_piomode = oldpiix_set_piomode,
228 .set_dmamode = oldpiix_set_dmamode, 231 .set_dmamode = oldpiix_set_dmamode,
229 .mode_filter = ata_pci_default_filter,
230
231 .tf_load = ata_tf_load,
232 .tf_read = ata_tf_read,
233 .check_status = ata_check_status,
234 .exec_command = ata_exec_command,
235 .dev_select = ata_std_dev_select,
236
237 .freeze = ata_bmdma_freeze,
238 .thaw = ata_bmdma_thaw,
239 .error_handler = oldpiix_pata_error_handler, 232 .error_handler = oldpiix_pata_error_handler,
240 .post_internal_cmd = ata_bmdma_post_internal_cmd,
241 .cable_detect = ata_cable_40wire,
242
243 .bmdma_setup = ata_bmdma_setup,
244 .bmdma_start = ata_bmdma_start,
245 .bmdma_stop = ata_bmdma_stop,
246 .bmdma_status = ata_bmdma_status,
247 .qc_prep = ata_qc_prep,
248 .qc_issue = oldpiix_qc_issue_prot,
249 .data_xfer = ata_data_xfer,
250
251 .irq_handler = ata_interrupt,
252 .irq_clear = ata_bmdma_irq_clear,
253 .irq_on = ata_irq_on,
254
255 .port_start = ata_sff_port_start,
256}; 233};
257 234
258 235
diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c
index 1deacfa0be07..c4a0795c3ff4 100644
--- a/drivers/ata/pata_opti.c
+++ b/drivers/ata/pata_opti.c
@@ -169,29 +169,10 @@ static struct scsi_host_template opti_sht = {
169}; 169};
170 170
171static struct ata_port_operations opti_port_ops = { 171static struct ata_port_operations opti_port_ops = {
172 .inherits = &ata_sff_port_ops,
173 .cable_detect = ata_cable_40wire,
172 .set_piomode = opti_set_piomode, 174 .set_piomode = opti_set_piomode,
173 .tf_load = ata_tf_load,
174 .tf_read = ata_tf_read,
175 .check_status = ata_check_status,
176 .exec_command = ata_exec_command,
177 .dev_select = ata_std_dev_select,
178
179 .freeze = ata_bmdma_freeze,
180 .thaw = ata_bmdma_thaw,
181 .error_handler = opti_error_handler, 175 .error_handler = opti_error_handler,
182 .post_internal_cmd = ata_bmdma_post_internal_cmd,
183 .cable_detect = ata_cable_40wire,
184
185 .qc_prep = ata_qc_prep,
186 .qc_issue = ata_qc_issue_prot,
187
188 .data_xfer = ata_data_xfer,
189
190 .irq_handler = ata_interrupt,
191 .irq_clear = ata_noop_irq_clear,
192 .irq_on = ata_irq_on,
193
194 .port_start = ata_sff_port_start,
195}; 176};
196 177
197static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id) 178static int opti_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_optidma.c b/drivers/ata/pata_optidma.c
index 7495758a86fe..eb4b08190e3a 100644
--- a/drivers/ata/pata_optidma.c
+++ b/drivers/ata/pata_optidma.c
@@ -354,73 +354,18 @@ static struct scsi_host_template optidma_sht = {
354}; 354};
355 355
356static struct ata_port_operations optidma_port_ops = { 356static struct ata_port_operations optidma_port_ops = {
357 .inherits = &ata_bmdma_port_ops,
358 .cable_detect = ata_cable_40wire,
357 .set_piomode = optidma_set_pio_mode, 359 .set_piomode = optidma_set_pio_mode,
358 .set_dmamode = optidma_set_dma_mode, 360 .set_dmamode = optidma_set_dma_mode,
359 .mode_filter = ata_pci_default_filter,
360
361 .tf_load = ata_tf_load,
362 .tf_read = ata_tf_read,
363 .check_status = ata_check_status,
364 .exec_command = ata_exec_command,
365 .dev_select = ata_std_dev_select,
366
367 .freeze = ata_bmdma_freeze,
368 .thaw = ata_bmdma_thaw,
369 .post_internal_cmd = ata_bmdma_post_internal_cmd,
370 .error_handler = optidma_error_handler,
371 .set_mode = optidma_set_mode, 361 .set_mode = optidma_set_mode,
372 .cable_detect = ata_cable_40wire, 362 .error_handler = optidma_error_handler,
373
374 .bmdma_setup = ata_bmdma_setup,
375 .bmdma_start = ata_bmdma_start,
376 .bmdma_stop = ata_bmdma_stop,
377 .bmdma_status = ata_bmdma_status,
378
379 .qc_prep = ata_qc_prep,
380 .qc_issue = ata_qc_issue_prot,
381
382 .data_xfer = ata_data_xfer,
383
384 .irq_handler = ata_interrupt,
385 .irq_clear = ata_bmdma_irq_clear,
386 .irq_on = ata_irq_on,
387
388 .port_start = ata_sff_port_start,
389}; 363};
390 364
391static struct ata_port_operations optiplus_port_ops = { 365static struct ata_port_operations optiplus_port_ops = {
366 .inherits = &optidma_port_ops,
392 .set_piomode = optiplus_set_pio_mode, 367 .set_piomode = optiplus_set_pio_mode,
393 .set_dmamode = optiplus_set_dma_mode, 368 .set_dmamode = optiplus_set_dma_mode,
394 .mode_filter = ata_pci_default_filter,
395
396 .tf_load = ata_tf_load,
397 .tf_read = ata_tf_read,
398 .check_status = ata_check_status,
399 .exec_command = ata_exec_command,
400 .dev_select = ata_std_dev_select,
401
402 .freeze = ata_bmdma_freeze,
403 .thaw = ata_bmdma_thaw,
404 .post_internal_cmd = ata_bmdma_post_internal_cmd,
405 .error_handler = optidma_error_handler,
406 .set_mode = optidma_set_mode,
407 .cable_detect = ata_cable_40wire,
408
409 .bmdma_setup = ata_bmdma_setup,
410 .bmdma_start = ata_bmdma_start,
411 .bmdma_stop = ata_bmdma_stop,
412 .bmdma_status = ata_bmdma_status,
413
414 .qc_prep = ata_qc_prep,
415 .qc_issue = ata_qc_issue_prot,
416
417 .data_xfer = ata_data_xfer,
418
419 .irq_handler = ata_interrupt,
420 .irq_clear = ata_bmdma_irq_clear,
421 .irq_on = ata_irq_on,
422
423 .port_start = ata_sff_port_start,
424}; 369};
425 370
426/** 371/**
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index c05b36c94d51..57efbf05c95f 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -132,53 +132,17 @@ static struct scsi_host_template pcmcia_sht = {
132}; 132};
133 133
134static struct ata_port_operations pcmcia_port_ops = { 134static struct ata_port_operations pcmcia_port_ops = {
135 .set_mode = pcmcia_set_mode, 135 .inherits = &ata_sff_port_ops,
136 .tf_load = ata_tf_load,
137 .tf_read = ata_tf_read,
138 .check_status = ata_check_status,
139 .exec_command = ata_exec_command,
140 .dev_select = ata_std_dev_select,
141
142 .freeze = ata_bmdma_freeze,
143 .thaw = ata_bmdma_thaw,
144 .error_handler = ata_bmdma_error_handler,
145 .post_internal_cmd = ata_bmdma_post_internal_cmd,
146 .cable_detect = ata_cable_40wire,
147
148 .qc_prep = ata_qc_prep,
149 .qc_issue = ata_qc_issue_prot,
150
151 .data_xfer = ata_data_xfer_noirq, 136 .data_xfer = ata_data_xfer_noirq,
152 137 .cable_detect = ata_cable_40wire,
153 .irq_clear = ata_noop_irq_clear, 138 .set_mode = pcmcia_set_mode,
154 .irq_on = ata_irq_on,
155
156 .port_start = ata_sff_port_start,
157}; 139};
158 140
159static struct ata_port_operations pcmcia_8bit_port_ops = { 141static struct ata_port_operations pcmcia_8bit_port_ops = {
160 .set_mode = pcmcia_set_mode_8bit, 142 .inherits = &ata_sff_port_ops,
161 .tf_load = ata_tf_load,
162 .tf_read = ata_tf_read,
163 .check_status = ata_check_status,
164 .exec_command = ata_exec_command,
165 .dev_select = ata_std_dev_select,
166
167 .freeze = ata_bmdma_freeze,
168 .thaw = ata_bmdma_thaw,
169 .error_handler = ata_bmdma_error_handler,
170 .post_internal_cmd = ata_bmdma_post_internal_cmd,
171 .cable_detect = ata_cable_40wire,
172
173 .qc_prep = ata_qc_prep,
174 .qc_issue = ata_qc_issue_prot,
175
176 .data_xfer = ata_data_xfer_8bit, 143 .data_xfer = ata_data_xfer_8bit,
177 144 .cable_detect = ata_cable_40wire,
178 .irq_clear = ata_noop_irq_clear, 145 .set_mode = pcmcia_set_mode_8bit,
179 .irq_on = ata_irq_on,
180
181 .port_start = ata_sff_port_start,
182}; 146};
183 147
184#define CS_CHECK(fn, ret) \ 148#define CS_CHECK(fn, ret) \
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 229d9acd934a..f619c20dd192 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -133,66 +133,18 @@ static struct scsi_host_template pdc2027x_sht = {
133}; 133};
134 134
135static struct ata_port_operations pdc2027x_pata100_ops = { 135static struct ata_port_operations pdc2027x_pata100_ops = {
136 .mode_filter = ata_pci_default_filter, 136 .inherits = &ata_bmdma_port_ops,
137
138 .tf_load = ata_tf_load,
139 .tf_read = ata_tf_read,
140 .check_status = ata_check_status,
141 .exec_command = ata_exec_command,
142 .dev_select = ata_std_dev_select,
143
144 .check_atapi_dma = pdc2027x_check_atapi_dma, 137 .check_atapi_dma = pdc2027x_check_atapi_dma,
145 .bmdma_setup = ata_bmdma_setup,
146 .bmdma_start = ata_bmdma_start,
147 .bmdma_stop = ata_bmdma_stop,
148 .bmdma_status = ata_bmdma_status,
149 .qc_prep = ata_qc_prep,
150 .qc_issue = ata_qc_issue_prot,
151 .data_xfer = ata_data_xfer,
152
153 .freeze = ata_bmdma_freeze,
154 .thaw = ata_bmdma_thaw,
155 .error_handler = pdc2027x_error_handler,
156 .post_internal_cmd = ata_bmdma_post_internal_cmd,
157 .cable_detect = pdc2027x_cable_detect, 138 .cable_detect = pdc2027x_cable_detect,
158 139 .error_handler = pdc2027x_error_handler,
159 .irq_clear = ata_bmdma_irq_clear,
160 .irq_on = ata_irq_on,
161
162 .port_start = ata_sff_port_start,
163}; 140};
164 141
165static struct ata_port_operations pdc2027x_pata133_ops = { 142static struct ata_port_operations pdc2027x_pata133_ops = {
143 .inherits = &pdc2027x_pata100_ops,
144 .mode_filter = pdc2027x_mode_filter,
166 .set_piomode = pdc2027x_set_piomode, 145 .set_piomode = pdc2027x_set_piomode,
167 .set_dmamode = pdc2027x_set_dmamode, 146 .set_dmamode = pdc2027x_set_dmamode,
168 .set_mode = pdc2027x_set_mode, 147 .set_mode = pdc2027x_set_mode,
169 .mode_filter = pdc2027x_mode_filter,
170
171 .tf_load = ata_tf_load,
172 .tf_read = ata_tf_read,
173 .check_status = ata_check_status,
174 .exec_command = ata_exec_command,
175 .dev_select = ata_std_dev_select,
176
177 .check_atapi_dma = pdc2027x_check_atapi_dma,
178 .bmdma_setup = ata_bmdma_setup,
179 .bmdma_start = ata_bmdma_start,
180 .bmdma_stop = ata_bmdma_stop,
181 .bmdma_status = ata_bmdma_status,
182 .qc_prep = ata_qc_prep,
183 .qc_issue = ata_qc_issue_prot,
184 .data_xfer = ata_data_xfer,
185
186 .freeze = ata_bmdma_freeze,
187 .thaw = ata_bmdma_thaw,
188 .error_handler = pdc2027x_error_handler,
189 .post_internal_cmd = ata_bmdma_post_internal_cmd,
190 .cable_detect = pdc2027x_cable_detect,
191
192 .irq_clear = ata_bmdma_irq_clear,
193 .irq_on = ata_irq_on,
194
195 .port_start = ata_sff_port_start,
196}; 148};
197 149
198static struct ata_port_info pdc2027x_port_info[] = { 150static struct ata_port_info pdc2027x_port_info[] = {
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index 564ee0798ec1..4daac20df0bc 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -266,69 +266,24 @@ static struct scsi_host_template pdc202xx_sht = {
266}; 266};
267 267
268static struct ata_port_operations pdc2024x_port_ops = { 268static struct ata_port_operations pdc2024x_port_ops = {
269 .set_piomode = pdc202xx_set_piomode, 269 .inherits = &ata_bmdma_port_ops,
270 .set_dmamode = pdc202xx_set_dmamode, 270
271 .mode_filter = ata_pci_default_filter, 271 .cable_detect = ata_cable_40wire,
272 .tf_load = ata_tf_load, 272 .set_piomode = pdc202xx_set_piomode,
273 .tf_read = ata_tf_read, 273 .set_dmamode = pdc202xx_set_dmamode,
274 .check_status = ata_check_status,
275 .exec_command = ata_exec_command,
276 .dev_select = ata_std_dev_select,
277
278 .freeze = ata_bmdma_freeze,
279 .thaw = ata_bmdma_thaw,
280 .error_handler = ata_bmdma_error_handler,
281 .post_internal_cmd = ata_bmdma_post_internal_cmd,
282 .cable_detect = ata_cable_40wire,
283
284 .bmdma_setup = ata_bmdma_setup,
285 .bmdma_start = ata_bmdma_start,
286 .bmdma_stop = ata_bmdma_stop,
287 .bmdma_status = ata_bmdma_status,
288
289 .qc_prep = ata_qc_prep,
290 .qc_issue = ata_qc_issue_prot,
291 .data_xfer = ata_data_xfer,
292
293 .irq_handler = ata_interrupt,
294 .irq_clear = ata_bmdma_irq_clear,
295 .irq_on = ata_irq_on,
296
297 .port_start = ata_sff_port_start,
298}; 274};
299 275
300static struct ata_port_operations pdc2026x_port_ops = { 276static struct ata_port_operations pdc2026x_port_ops = {
301 .set_piomode = pdc202xx_set_piomode, 277 .inherits = &pdc2024x_port_ops,
302 .set_dmamode = pdc202xx_set_dmamode, 278
303 .mode_filter = ata_pci_default_filter, 279 .check_atapi_dma = pdc2026x_check_atapi_dma,
304 .tf_load = ata_tf_load, 280 .bmdma_start = pdc2026x_bmdma_start,
305 .tf_read = ata_tf_read, 281 .bmdma_stop = pdc2026x_bmdma_stop,
306 .check_status = ata_check_status, 282
307 .exec_command = ata_exec_command, 283 .cable_detect = pdc2026x_cable_detect,
308 .dev_select = ata_std_dev_select, 284 .dev_config = pdc2026x_dev_config,
309 .dev_config = pdc2026x_dev_config, 285
310 286 .port_start = pdc2026x_port_start,
311 .freeze = ata_bmdma_freeze,
312 .thaw = ata_bmdma_thaw,
313 .error_handler = ata_bmdma_error_handler,
314 .post_internal_cmd = ata_bmdma_post_internal_cmd,
315 .cable_detect = pdc2026x_cable_detect,
316
317 .check_atapi_dma= pdc2026x_check_atapi_dma,
318 .bmdma_setup = ata_bmdma_setup,
319 .bmdma_start = pdc2026x_bmdma_start,
320 .bmdma_stop = pdc2026x_bmdma_stop,
321 .bmdma_status = ata_bmdma_status,
322
323 .qc_prep = ata_qc_prep,
324 .qc_issue = ata_qc_issue_prot,
325 .data_xfer = ata_data_xfer,
326
327 .irq_handler = ata_interrupt,
328 .irq_clear = ata_bmdma_irq_clear,
329 .irq_on = ata_irq_on,
330
331 .port_start = pdc2026x_port_start,
332}; 287};
333 288
334static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) 289static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index cd2d03a4591a..0588c9b7e73e 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -51,27 +51,11 @@ static struct scsi_host_template pata_platform_sht = {
51}; 51};
52 52
53static struct ata_port_operations pata_platform_port_ops = { 53static struct ata_port_operations pata_platform_port_ops = {
54 .set_mode = pata_platform_set_mode, 54 .inherits = &ata_sff_port_ops,
55
56 .tf_load = ata_tf_load,
57 .tf_read = ata_tf_read,
58 .check_status = ata_check_status,
59 .exec_command = ata_exec_command,
60 .dev_select = ata_std_dev_select,
61
62 .freeze = ata_bmdma_freeze,
63 .thaw = ata_bmdma_thaw,
64 .error_handler = ata_bmdma_error_handler,
65 .post_internal_cmd = ata_bmdma_post_internal_cmd,
66 .cable_detect = ata_cable_unknown,
67
68 .qc_prep = ata_qc_prep,
69 .qc_issue = ata_qc_issue_prot,
70
71 .data_xfer = ata_data_xfer_noirq, 55 .data_xfer = ata_data_xfer_noirq,
72 56 .cable_detect = ata_cable_unknown,
73 .irq_clear = ata_noop_irq_clear, 57 .set_mode = pata_platform_set_mode,
74 .irq_on = ata_irq_on, 58 .port_start = ATA_OP_NULL,
75}; 59};
76 60
77static void pata_platform_setup_port(struct ata_ioports *ioaddr, 61static void pata_platform_setup_port(struct ata_ioports *ioaddr,
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index ccb8682300b8..d16b343d2a62 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -158,55 +158,16 @@ static struct scsi_host_template qdi_sht = {
158}; 158};
159 159
160static struct ata_port_operations qdi6500_port_ops = { 160static struct ata_port_operations qdi6500_port_ops = {
161 .set_piomode = qdi6500_set_piomode, 161 .inherits = &ata_sff_port_ops,
162
163 .tf_load = ata_tf_load,
164 .tf_read = ata_tf_read,
165 .check_status = ata_check_status,
166 .exec_command = ata_exec_command,
167 .dev_select = ata_std_dev_select,
168
169 .freeze = ata_bmdma_freeze,
170 .thaw = ata_bmdma_thaw,
171 .error_handler = ata_bmdma_error_handler,
172 .post_internal_cmd = ata_bmdma_post_internal_cmd,
173 .cable_detect = ata_cable_40wire,
174
175 .qc_prep = ata_qc_prep,
176 .qc_issue = qdi_qc_issue_prot, 162 .qc_issue = qdi_qc_issue_prot,
177
178 .data_xfer = qdi_data_xfer, 163 .data_xfer = qdi_data_xfer,
179 164 .cable_detect = ata_cable_40wire,
180 .irq_clear = ata_noop_irq_clear, 165 .set_piomode = qdi6500_set_piomode,
181 .irq_on = ata_irq_on,
182
183 .port_start = ata_sff_port_start,
184}; 166};
185 167
186static struct ata_port_operations qdi6580_port_ops = { 168static struct ata_port_operations qdi6580_port_ops = {
169 .inherits = &qdi6500_port_ops,
187 .set_piomode = qdi6580_set_piomode, 170 .set_piomode = qdi6580_set_piomode,
188
189 .tf_load = ata_tf_load,
190 .tf_read = ata_tf_read,
191 .check_status = ata_check_status,
192 .exec_command = ata_exec_command,
193 .dev_select = ata_std_dev_select,
194
195 .freeze = ata_bmdma_freeze,
196 .thaw = ata_bmdma_thaw,
197 .error_handler = ata_bmdma_error_handler,
198 .post_internal_cmd = ata_bmdma_post_internal_cmd,
199 .cable_detect = ata_cable_40wire,
200
201 .qc_prep = ata_qc_prep,
202 .qc_issue = qdi_qc_issue_prot,
203
204 .data_xfer = qdi_data_xfer,
205
206 .irq_clear = ata_noop_irq_clear,
207 .irq_on = ata_irq_on,
208
209 .port_start = ata_sff_port_start,
210}; 171};
211 172
212/** 173/**
diff --git a/drivers/ata/pata_radisys.c b/drivers/ata/pata_radisys.c
index 3981bf84d093..94e60b3a1ec6 100644
--- a/drivers/ata/pata_radisys.c
+++ b/drivers/ata/pata_radisys.c
@@ -188,36 +188,12 @@ static struct scsi_host_template radisys_sht = {
188 ATA_BMDMA_SHT(DRV_NAME), 188 ATA_BMDMA_SHT(DRV_NAME),
189}; 189};
190 190
191static const struct ata_port_operations radisys_pata_ops = { 191static struct ata_port_operations radisys_pata_ops = {
192 .inherits = &ata_bmdma_port_ops,
193 .qc_issue = radisys_qc_issue_prot,
194 .cable_detect = ata_cable_unknown,
192 .set_piomode = radisys_set_piomode, 195 .set_piomode = radisys_set_piomode,
193 .set_dmamode = radisys_set_dmamode, 196 .set_dmamode = radisys_set_dmamode,
194 .mode_filter = ata_pci_default_filter,
195
196 .tf_load = ata_tf_load,
197 .tf_read = ata_tf_read,
198 .check_status = ata_check_status,
199 .exec_command = ata_exec_command,
200 .dev_select = ata_std_dev_select,
201
202 .freeze = ata_bmdma_freeze,
203 .thaw = ata_bmdma_thaw,
204 .error_handler = ata_bmdma_error_handler,
205 .post_internal_cmd = ata_bmdma_post_internal_cmd,
206 .cable_detect = ata_cable_unknown,
207
208 .bmdma_setup = ata_bmdma_setup,
209 .bmdma_start = ata_bmdma_start,
210 .bmdma_stop = ata_bmdma_stop,
211 .bmdma_status = ata_bmdma_status,
212 .qc_prep = ata_qc_prep,
213 .qc_issue = radisys_qc_issue_prot,
214 .data_xfer = ata_data_xfer,
215
216 .irq_handler = ata_interrupt,
217 .irq_clear = ata_bmdma_irq_clear,
218 .irq_on = ata_irq_on,
219
220 .port_start = ata_sff_port_start,
221}; 197};
222 198
223 199
diff --git a/drivers/ata/pata_rb500_cf.c b/drivers/ata/pata_rb500_cf.c
index 4543c980342c..7affceec1c29 100644
--- a/drivers/ata/pata_rb500_cf.c
+++ b/drivers/ata/pata_rb500_cf.c
@@ -118,25 +118,11 @@ static irqreturn_t rb500_pata_irq_handler(int irq, void *dev_instance)
118} 118}
119 119
120static struct ata_port_operations rb500_pata_port_ops = { 120static struct ata_port_operations rb500_pata_port_ops = {
121 .tf_load = ata_tf_load, 121 .inherits = &ata_sff_port_ops,
122 .tf_read = ata_tf_read,
123
124 .exec_command = rb500_pata_exec_command, 122 .exec_command = rb500_pata_exec_command,
125 .check_status = ata_check_status,
126 .dev_select = ata_std_dev_select,
127
128 .data_xfer = rb500_pata_data_xfer, 123 .data_xfer = rb500_pata_data_xfer,
129
130 .qc_prep = ata_qc_prep,
131 .qc_issue = ata_qc_issue_prot,
132
133 .freeze = rb500_pata_freeze, 124 .freeze = rb500_pata_freeze,
134 .thaw = rb500_pata_thaw, 125 .thaw = rb500_pata_thaw,
135 .error_handler = ata_bmdma_error_handler,
136 .post_internal_cmd = ata_bmdma_post_internal_cmd,
137
138 .irq_clear = ata_noop_irq_clear,
139 .irq_on = ata_irq_on,
140}; 126};
141 127
142/* ------------------------------------------------------------------------ */ 128/* ------------------------------------------------------------------------ */
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c
index 80909a607d36..a2aef7328bfc 100644
--- a/drivers/ata/pata_rz1000.c
+++ b/drivers/ata/pata_rz1000.c
@@ -57,30 +57,9 @@ static struct scsi_host_template rz1000_sht = {
57}; 57};
58 58
59static struct ata_port_operations rz1000_port_ops = { 59static struct ata_port_operations rz1000_port_ops = {
60 .set_mode = rz1000_set_mode, 60 .inherits = &ata_sff_port_ops,
61
62 .tf_load = ata_tf_load,
63 .tf_read = ata_tf_read,
64 .check_status = ata_check_status,
65 .exec_command = ata_exec_command,
66 .dev_select = ata_std_dev_select,
67
68 .qc_prep = ata_qc_prep,
69 .qc_issue = ata_qc_issue_prot,
70
71 .data_xfer = ata_data_xfer,
72
73 .freeze = ata_bmdma_freeze,
74 .thaw = ata_bmdma_thaw,
75 .error_handler = ata_bmdma_error_handler,
76 .post_internal_cmd = ata_bmdma_post_internal_cmd,
77 .cable_detect = ata_cable_40wire, 61 .cable_detect = ata_cable_40wire,
78 62 .set_mode = rz1000_set_mode,
79 .irq_handler = ata_interrupt,
80 .irq_clear = ata_noop_irq_clear,
81 .irq_on = ata_irq_on,
82
83 .port_start = ata_sff_port_start,
84}; 63};
85 64
86static int rz1000_fifo_disable(struct pci_dev *pdev) 65static int rz1000_fifo_disable(struct pci_dev *pdev)
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
index 38ce6e12ee3d..362b7f829d8e 100644
--- a/drivers/ata/pata_sc1200.c
+++ b/drivers/ata/pata_sc1200.c
@@ -184,37 +184,12 @@ static struct scsi_host_template sc1200_sht = {
184}; 184};
185 185
186static struct ata_port_operations sc1200_port_ops = { 186static struct ata_port_operations sc1200_port_ops = {
187 .set_piomode = sc1200_set_piomode, 187 .inherits = &ata_bmdma_port_ops,
188 .set_dmamode = sc1200_set_dmamode,
189 .mode_filter = ata_pci_default_filter,
190
191 .tf_load = ata_tf_load,
192 .tf_read = ata_tf_read,
193 .check_status = ata_check_status,
194 .exec_command = ata_exec_command,
195 .dev_select = ata_std_dev_select,
196
197 .freeze = ata_bmdma_freeze,
198 .thaw = ata_bmdma_thaw,
199 .error_handler = ata_bmdma_error_handler,
200 .post_internal_cmd = ata_bmdma_post_internal_cmd,
201 .cable_detect = ata_cable_40wire,
202
203 .bmdma_setup = ata_bmdma_setup,
204 .bmdma_start = ata_bmdma_start,
205 .bmdma_stop = ata_bmdma_stop,
206 .bmdma_status = ata_bmdma_status,
207
208 .qc_prep = ata_dumb_qc_prep, 188 .qc_prep = ata_dumb_qc_prep,
209 .qc_issue = sc1200_qc_issue_prot, 189 .qc_issue = sc1200_qc_issue_prot,
210 190 .cable_detect = ata_cable_40wire,
211 .data_xfer = ata_data_xfer, 191 .set_piomode = sc1200_set_piomode,
212 192 .set_dmamode = sc1200_set_dmamode,
213 .irq_handler = ata_interrupt,
214 .irq_clear = ata_bmdma_irq_clear,
215 .irq_on = ata_irq_on,
216
217 .port_start = ata_sff_port_start,
218}; 193};
219 194
220/** 195/**
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c
index 1833e9ef522e..033d1f3a82de 100644
--- a/drivers/ata/pata_scc.c
+++ b/drivers/ata/pata_scc.c
@@ -972,6 +972,8 @@ static struct scsi_host_template scc_sht = {
972}; 972};
973 973
974static const struct ata_port_operations scc_pata_ops = { 974static const struct ata_port_operations scc_pata_ops = {
975 .inherits = &ata_bmdma_port_ops,
976
975 .set_piomode = scc_set_piomode, 977 .set_piomode = scc_set_piomode,
976 .set_dmamode = scc_set_dmamode, 978 .set_dmamode = scc_set_dmamode,
977 .mode_filter = scc_mode_filter, 979 .mode_filter = scc_mode_filter,
@@ -989,12 +991,7 @@ static const struct ata_port_operations scc_pata_ops = {
989 .bmdma_status = scc_bmdma_status, 991 .bmdma_status = scc_bmdma_status,
990 .data_xfer = scc_data_xfer, 992 .data_xfer = scc_data_xfer,
991 993
992 .qc_prep = ata_qc_prep,
993 .qc_issue = ata_qc_issue_prot,
994
995 .freeze = scc_bmdma_freeze, 994 .freeze = scc_bmdma_freeze,
996 .thaw = ata_bmdma_thaw,
997
998 .error_handler = scc_error_handler, 995 .error_handler = scc_error_handler,
999 .post_internal_cmd = scc_bmdma_stop, 996 .post_internal_cmd = scc_bmdma_stop,
1000 997
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 318a36988900..627abcf85c6e 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -302,71 +302,16 @@ static struct scsi_host_template serverworks_sht = {
302}; 302};
303 303
304static struct ata_port_operations serverworks_osb4_port_ops = { 304static struct ata_port_operations serverworks_osb4_port_ops = {
305 .inherits = &ata_bmdma_port_ops,
306 .cable_detect = serverworks_cable_detect,
307 .mode_filter = serverworks_osb4_filter,
305 .set_piomode = serverworks_set_piomode, 308 .set_piomode = serverworks_set_piomode,
306 .set_dmamode = serverworks_set_dmamode, 309 .set_dmamode = serverworks_set_dmamode,
307 .mode_filter = serverworks_osb4_filter,
308
309 .tf_load = ata_tf_load,
310 .tf_read = ata_tf_read,
311 .check_status = ata_check_status,
312 .exec_command = ata_exec_command,
313 .dev_select = ata_std_dev_select,
314
315 .freeze = ata_bmdma_freeze,
316 .thaw = ata_bmdma_thaw,
317 .error_handler = ata_bmdma_error_handler,
318 .post_internal_cmd = ata_bmdma_post_internal_cmd,
319 .cable_detect = serverworks_cable_detect,
320
321 .bmdma_setup = ata_bmdma_setup,
322 .bmdma_start = ata_bmdma_start,
323 .bmdma_stop = ata_bmdma_stop,
324 .bmdma_status = ata_bmdma_status,
325
326 .qc_prep = ata_qc_prep,
327 .qc_issue = ata_qc_issue_prot,
328
329 .data_xfer = ata_data_xfer,
330
331 .irq_handler = ata_interrupt,
332 .irq_clear = ata_bmdma_irq_clear,
333 .irq_on = ata_irq_on,
334
335 .port_start = ata_sff_port_start,
336}; 310};
337 311
338static struct ata_port_operations serverworks_csb_port_ops = { 312static struct ata_port_operations serverworks_csb_port_ops = {
339 .set_piomode = serverworks_set_piomode, 313 .inherits = &serverworks_osb4_port_ops,
340 .set_dmamode = serverworks_set_dmamode,
341 .mode_filter = serverworks_csb_filter, 314 .mode_filter = serverworks_csb_filter,
342
343 .tf_load = ata_tf_load,
344 .tf_read = ata_tf_read,
345 .check_status = ata_check_status,
346 .exec_command = ata_exec_command,
347 .dev_select = ata_std_dev_select,
348
349 .freeze = ata_bmdma_freeze,
350 .thaw = ata_bmdma_thaw,
351 .error_handler = ata_bmdma_error_handler,
352 .post_internal_cmd = ata_bmdma_post_internal_cmd,
353 .cable_detect = serverworks_cable_detect,
354
355 .bmdma_setup = ata_bmdma_setup,
356 .bmdma_start = ata_bmdma_start,
357 .bmdma_stop = ata_bmdma_stop,
358 .bmdma_status = ata_bmdma_status,
359
360 .qc_prep = ata_qc_prep,
361 .qc_issue = ata_qc_issue_prot,
362
363 .data_xfer = ata_data_xfer,
364
365 .irq_handler = ata_interrupt,
366 .irq_clear = ata_bmdma_irq_clear,
367 .irq_on = ata_irq_on,
368
369 .port_start = ata_sff_port_start,
370}; 315};
371 316
372static int serverworks_fixup_osb4(struct pci_dev *pdev) 317static int serverworks_fixup_osb4(struct pci_dev *pdev)
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 7812815a34c3..0936f534d9c7 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -196,36 +196,10 @@ static struct scsi_host_template sil680_sht = {
196}; 196};
197 197
198static struct ata_port_operations sil680_port_ops = { 198static struct ata_port_operations sil680_port_ops = {
199 .inherits = &ata_bmdma_port_ops,
200 .cable_detect = sil680_cable_detect,
199 .set_piomode = sil680_set_piomode, 201 .set_piomode = sil680_set_piomode,
200 .set_dmamode = sil680_set_dmamode, 202 .set_dmamode = sil680_set_dmamode,
201 .mode_filter = ata_pci_default_filter,
202 .tf_load = ata_tf_load,
203 .tf_read = ata_tf_read,
204 .check_status = ata_check_status,
205 .exec_command = ata_exec_command,
206 .dev_select = ata_std_dev_select,
207
208 .freeze = ata_bmdma_freeze,
209 .thaw = ata_bmdma_thaw,
210 .error_handler = ata_bmdma_error_handler,
211 .post_internal_cmd = ata_bmdma_post_internal_cmd,
212 .cable_detect = sil680_cable_detect,
213
214 .bmdma_setup = ata_bmdma_setup,
215 .bmdma_start = ata_bmdma_start,
216 .bmdma_stop = ata_bmdma_stop,
217 .bmdma_status = ata_bmdma_status,
218
219 .qc_prep = ata_qc_prep,
220 .qc_issue = ata_qc_issue_prot,
221
222 .data_xfer = ata_data_xfer,
223
224 .irq_handler = ata_interrupt,
225 .irq_clear = ata_bmdma_irq_clear,
226 .irq_on = ata_irq_on,
227
228 .port_start = ata_sff_port_start,
229}; 203};
230 204
231/** 205/**
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index dcd8457a8377..3ed628670cd7 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -517,196 +517,51 @@ static struct scsi_host_template sis_sht = {
517 ATA_BMDMA_SHT(DRV_NAME), 517 ATA_BMDMA_SHT(DRV_NAME),
518}; 518};
519 519
520static const struct ata_port_operations sis_133_ops = { 520static struct ata_port_operations sis_133_for_sata_ops = {
521 .inherits = &ata_bmdma_port_ops,
521 .set_piomode = sis_133_set_piomode, 522 .set_piomode = sis_133_set_piomode,
522 .set_dmamode = sis_133_set_dmamode, 523 .set_dmamode = sis_133_set_dmamode,
523 .mode_filter = ata_pci_default_filter,
524
525 .tf_load = ata_tf_load,
526 .tf_read = ata_tf_read,
527 .check_status = ata_check_status,
528 .exec_command = ata_exec_command,
529 .dev_select = ata_std_dev_select,
530
531 .freeze = ata_bmdma_freeze,
532 .thaw = ata_bmdma_thaw,
533 .error_handler = sis_error_handler,
534 .post_internal_cmd = ata_bmdma_post_internal_cmd,
535 .cable_detect = sis_133_cable_detect, 524 .cable_detect = sis_133_cable_detect,
525};
536 526
537 .bmdma_setup = ata_bmdma_setup, 527static struct ata_port_operations sis_base_ops = {
538 .bmdma_start = ata_bmdma_start, 528 .inherits = &ata_bmdma_port_ops,
539 .bmdma_stop = ata_bmdma_stop, 529 .error_handler = sis_error_handler,
540 .bmdma_status = ata_bmdma_status,
541 .qc_prep = ata_qc_prep,
542 .qc_issue = ata_qc_issue_prot,
543 .data_xfer = ata_data_xfer,
544
545 .irq_handler = ata_interrupt,
546 .irq_clear = ata_bmdma_irq_clear,
547 .irq_on = ata_irq_on,
548
549 .port_start = ata_sff_port_start,
550}; 530};
551 531
552static const struct ata_port_operations sis_133_for_sata_ops = { 532static struct ata_port_operations sis_133_ops = {
533 .inherits = &sis_base_ops,
553 .set_piomode = sis_133_set_piomode, 534 .set_piomode = sis_133_set_piomode,
554 .set_dmamode = sis_133_set_dmamode, 535 .set_dmamode = sis_133_set_dmamode,
555 .mode_filter = ata_pci_default_filter,
556
557 .tf_load = ata_tf_load,
558 .tf_read = ata_tf_read,
559 .check_status = ata_check_status,
560 .exec_command = ata_exec_command,
561 .dev_select = ata_std_dev_select,
562
563 .freeze = ata_bmdma_freeze,
564 .thaw = ata_bmdma_thaw,
565 .error_handler = ata_bmdma_error_handler,
566 .post_internal_cmd = ata_bmdma_post_internal_cmd,
567 .cable_detect = sis_133_cable_detect, 536 .cable_detect = sis_133_cable_detect,
568
569 .bmdma_setup = ata_bmdma_setup,
570 .bmdma_start = ata_bmdma_start,
571 .bmdma_stop = ata_bmdma_stop,
572 .bmdma_status = ata_bmdma_status,
573 .qc_prep = ata_qc_prep,
574 .qc_issue = ata_qc_issue_prot,
575 .data_xfer = ata_data_xfer,
576
577 .irq_handler = ata_interrupt,
578 .irq_clear = ata_bmdma_irq_clear,
579 .irq_on = ata_irq_on,
580
581 .port_start = ata_sff_port_start,
582}; 537};
583 538
584static const struct ata_port_operations sis_133_early_ops = { 539static struct ata_port_operations sis_133_early_ops = {
540 .inherits = &sis_base_ops,
585 .set_piomode = sis_100_set_piomode, 541 .set_piomode = sis_100_set_piomode,
586 .set_dmamode = sis_133_early_set_dmamode, 542 .set_dmamode = sis_133_early_set_dmamode,
587 .mode_filter = ata_pci_default_filter,
588
589 .tf_load = ata_tf_load,
590 .tf_read = ata_tf_read,
591 .check_status = ata_check_status,
592 .exec_command = ata_exec_command,
593 .dev_select = ata_std_dev_select,
594
595 .freeze = ata_bmdma_freeze,
596 .thaw = ata_bmdma_thaw,
597 .error_handler = sis_error_handler,
598 .post_internal_cmd = ata_bmdma_post_internal_cmd,
599 .cable_detect = sis_66_cable_detect, 543 .cable_detect = sis_66_cable_detect,
600
601 .bmdma_setup = ata_bmdma_setup,
602 .bmdma_start = ata_bmdma_start,
603 .bmdma_stop = ata_bmdma_stop,
604 .bmdma_status = ata_bmdma_status,
605 .qc_prep = ata_qc_prep,
606 .qc_issue = ata_qc_issue_prot,
607 .data_xfer = ata_data_xfer,
608
609 .irq_handler = ata_interrupt,
610 .irq_clear = ata_bmdma_irq_clear,
611 .irq_on = ata_irq_on,
612
613 .port_start = ata_sff_port_start,
614}; 544};
615 545
616static const struct ata_port_operations sis_100_ops = { 546static struct ata_port_operations sis_100_ops = {
547 .inherits = &sis_base_ops,
617 .set_piomode = sis_100_set_piomode, 548 .set_piomode = sis_100_set_piomode,
618 .set_dmamode = sis_100_set_dmamode, 549 .set_dmamode = sis_100_set_dmamode,
619 .mode_filter = ata_pci_default_filter,
620
621 .tf_load = ata_tf_load,
622 .tf_read = ata_tf_read,
623 .check_status = ata_check_status,
624 .exec_command = ata_exec_command,
625 .dev_select = ata_std_dev_select,
626
627 .freeze = ata_bmdma_freeze,
628 .thaw = ata_bmdma_thaw,
629 .error_handler = sis_error_handler,
630 .post_internal_cmd = ata_bmdma_post_internal_cmd,
631 .cable_detect = sis_66_cable_detect, 550 .cable_detect = sis_66_cable_detect,
632
633 .bmdma_setup = ata_bmdma_setup,
634 .bmdma_start = ata_bmdma_start,
635 .bmdma_stop = ata_bmdma_stop,
636 .bmdma_status = ata_bmdma_status,
637 .qc_prep = ata_qc_prep,
638 .qc_issue = ata_qc_issue_prot,
639 .data_xfer = ata_data_xfer,
640
641 .irq_handler = ata_interrupt,
642 .irq_clear = ata_bmdma_irq_clear,
643 .irq_on = ata_irq_on,
644
645 .port_start = ata_sff_port_start,
646}; 551};
647 552
648static const struct ata_port_operations sis_66_ops = { 553static struct ata_port_operations sis_66_ops = {
554 .inherits = &sis_base_ops,
649 .set_piomode = sis_old_set_piomode, 555 .set_piomode = sis_old_set_piomode,
650 .set_dmamode = sis_66_set_dmamode, 556 .set_dmamode = sis_66_set_dmamode,
651 .mode_filter = ata_pci_default_filter,
652
653 .tf_load = ata_tf_load,
654 .tf_read = ata_tf_read,
655 .check_status = ata_check_status,
656 .exec_command = ata_exec_command,
657 .dev_select = ata_std_dev_select,
658 .cable_detect = sis_66_cable_detect, 557 .cable_detect = sis_66_cable_detect,
659
660 .freeze = ata_bmdma_freeze,
661 .thaw = ata_bmdma_thaw,
662 .error_handler = sis_error_handler,
663 .post_internal_cmd = ata_bmdma_post_internal_cmd,
664
665 .bmdma_setup = ata_bmdma_setup,
666 .bmdma_start = ata_bmdma_start,
667 .bmdma_stop = ata_bmdma_stop,
668 .bmdma_status = ata_bmdma_status,
669 .qc_prep = ata_qc_prep,
670 .qc_issue = ata_qc_issue_prot,
671 .data_xfer = ata_data_xfer,
672
673 .irq_handler = ata_interrupt,
674 .irq_clear = ata_bmdma_irq_clear,
675 .irq_on = ata_irq_on,
676
677 .port_start = ata_sff_port_start,
678}; 558};
679 559
680static const struct ata_port_operations sis_old_ops = { 560static struct ata_port_operations sis_old_ops = {
561 .inherits = &sis_base_ops,
681 .set_piomode = sis_old_set_piomode, 562 .set_piomode = sis_old_set_piomode,
682 .set_dmamode = sis_old_set_dmamode, 563 .set_dmamode = sis_old_set_dmamode,
683 .mode_filter = ata_pci_default_filter,
684
685 .tf_load = ata_tf_load,
686 .tf_read = ata_tf_read,
687 .check_status = ata_check_status,
688 .exec_command = ata_exec_command,
689 .dev_select = ata_std_dev_select,
690
691 .freeze = ata_bmdma_freeze,
692 .thaw = ata_bmdma_thaw,
693 .error_handler = sis_error_handler,
694 .post_internal_cmd = ata_bmdma_post_internal_cmd,
695 .cable_detect = ata_cable_40wire, 564 .cable_detect = ata_cable_40wire,
696
697 .bmdma_setup = ata_bmdma_setup,
698 .bmdma_start = ata_bmdma_start,
699 .bmdma_stop = ata_bmdma_stop,
700 .bmdma_status = ata_bmdma_status,
701 .qc_prep = ata_qc_prep,
702 .qc_issue = ata_qc_issue_prot,
703 .data_xfer = ata_data_xfer,
704
705 .irq_handler = ata_interrupt,
706 .irq_clear = ata_bmdma_irq_clear,
707 .irq_on = ata_irq_on,
708
709 .port_start = ata_sff_port_start,
710}; 565};
711 566
712static const struct ata_port_info sis_info = { 567static const struct ata_port_info sis_info = {
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c
index ece366bced0c..0dd8e2f69558 100644
--- a/drivers/ata/pata_sl82c105.c
+++ b/drivers/ata/pata_sl82c105.c
@@ -239,37 +239,13 @@ static struct scsi_host_template sl82c105_sht = {
239}; 239};
240 240
241static struct ata_port_operations sl82c105_port_ops = { 241static struct ata_port_operations sl82c105_port_ops = {
242 .set_piomode = sl82c105_set_piomode, 242 .inherits = &ata_bmdma_port_ops,
243 .mode_filter = ata_pci_default_filter, 243 .qc_defer = sl82c105_qc_defer,
244
245 .tf_load = ata_tf_load,
246 .tf_read = ata_tf_read,
247 .check_status = ata_check_status,
248 .exec_command = ata_exec_command,
249 .dev_select = ata_std_dev_select,
250
251 .freeze = ata_bmdma_freeze,
252 .thaw = ata_bmdma_thaw,
253 .error_handler = sl82c105_error_handler,
254 .post_internal_cmd = ata_bmdma_post_internal_cmd,
255 .cable_detect = ata_cable_40wire,
256
257 .bmdma_setup = ata_bmdma_setup,
258 .bmdma_start = sl82c105_bmdma_start, 244 .bmdma_start = sl82c105_bmdma_start,
259 .bmdma_stop = sl82c105_bmdma_stop, 245 .bmdma_stop = sl82c105_bmdma_stop,
260 .bmdma_status = ata_bmdma_status, 246 .cable_detect = ata_cable_40wire,
261 247 .set_piomode = sl82c105_set_piomode,
262 .qc_defer = sl82c105_qc_defer, 248 .error_handler = sl82c105_error_handler,
263 .qc_prep = ata_qc_prep,
264 .qc_issue = ata_qc_issue_prot,
265
266 .data_xfer = ata_data_xfer,
267
268 .irq_handler = ata_interrupt,
269 .irq_clear = ata_bmdma_irq_clear,
270 .irq_on = ata_irq_on,
271
272 .port_start = ata_sff_port_start,
273}; 249};
274 250
275/** 251/**
diff --git a/drivers/ata/pata_triflex.c b/drivers/ata/pata_triflex.c
index 510569957d10..bc4956ef0931 100644
--- a/drivers/ata/pata_triflex.c
+++ b/drivers/ata/pata_triflex.c
@@ -184,36 +184,12 @@ static struct scsi_host_template triflex_sht = {
184}; 184};
185 185
186static struct ata_port_operations triflex_port_ops = { 186static struct ata_port_operations triflex_port_ops = {
187 .set_piomode = triflex_set_piomode, 187 .inherits = &ata_bmdma_port_ops,
188 .mode_filter = ata_pci_default_filter,
189
190 .tf_load = ata_tf_load,
191 .tf_read = ata_tf_read,
192 .check_status = ata_check_status,
193 .exec_command = ata_exec_command,
194 .dev_select = ata_std_dev_select,
195
196 .freeze = ata_bmdma_freeze,
197 .thaw = ata_bmdma_thaw,
198 .error_handler = triflex_error_handler,
199 .post_internal_cmd = ata_bmdma_post_internal_cmd,
200 .cable_detect = ata_cable_40wire,
201
202 .bmdma_setup = ata_bmdma_setup,
203 .bmdma_start = triflex_bmdma_start, 188 .bmdma_start = triflex_bmdma_start,
204 .bmdma_stop = triflex_bmdma_stop, 189 .bmdma_stop = triflex_bmdma_stop,
205 .bmdma_status = ata_bmdma_status, 190 .cable_detect = ata_cable_40wire,
206 191 .set_piomode = triflex_set_piomode,
207 .qc_prep = ata_qc_prep, 192 .error_handler = triflex_error_handler,
208 .qc_issue = ata_qc_issue_prot,
209
210 .data_xfer = ata_data_xfer,
211
212 .irq_handler = ata_interrupt,
213 .irq_clear = ata_bmdma_irq_clear,
214 .irq_on = ata_irq_on,
215
216 .port_start = ata_sff_port_start,
217}; 193};
218 194
219static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id) 195static int triflex_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index a7bc860e1310..d1edb1b27480 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -339,71 +339,16 @@ static struct scsi_host_template via_sht = {
339}; 339};
340 340
341static struct ata_port_operations via_port_ops = { 341static struct ata_port_operations via_port_ops = {
342 .inherits = &ata_bmdma_port_ops,
343 .cable_detect = via_cable_detect,
342 .set_piomode = via_set_piomode, 344 .set_piomode = via_set_piomode,
343 .set_dmamode = via_set_dmamode, 345 .set_dmamode = via_set_dmamode,
344 .mode_filter = ata_pci_default_filter,
345
346 .tf_load = ata_tf_load,
347 .tf_read = ata_tf_read,
348 .check_status = ata_check_status,
349 .exec_command = ata_exec_command,
350 .dev_select = ata_std_dev_select,
351
352 .freeze = ata_bmdma_freeze,
353 .thaw = ata_bmdma_thaw,
354 .error_handler = via_error_handler, 346 .error_handler = via_error_handler,
355 .post_internal_cmd = ata_bmdma_post_internal_cmd,
356 .cable_detect = via_cable_detect,
357
358 .bmdma_setup = ata_bmdma_setup,
359 .bmdma_start = ata_bmdma_start,
360 .bmdma_stop = ata_bmdma_stop,
361 .bmdma_status = ata_bmdma_status,
362
363 .qc_prep = ata_qc_prep,
364 .qc_issue = ata_qc_issue_prot,
365
366 .data_xfer = ata_data_xfer,
367
368 .irq_handler = ata_interrupt,
369 .irq_clear = ata_bmdma_irq_clear,
370 .irq_on = ata_irq_on,
371
372 .port_start = ata_sff_port_start,
373}; 347};
374 348
375static struct ata_port_operations via_port_ops_noirq = { 349static struct ata_port_operations via_port_ops_noirq = {
376 .set_piomode = via_set_piomode, 350 .inherits = &via_port_ops,
377 .set_dmamode = via_set_dmamode,
378 .mode_filter = ata_pci_default_filter,
379
380 .tf_load = ata_tf_load,
381 .tf_read = ata_tf_read,
382 .check_status = ata_check_status,
383 .exec_command = ata_exec_command,
384 .dev_select = ata_std_dev_select,
385
386 .freeze = ata_bmdma_freeze,
387 .thaw = ata_bmdma_thaw,
388 .error_handler = via_error_handler,
389 .post_internal_cmd = ata_bmdma_post_internal_cmd,
390 .cable_detect = via_cable_detect,
391
392 .bmdma_setup = ata_bmdma_setup,
393 .bmdma_start = ata_bmdma_start,
394 .bmdma_stop = ata_bmdma_stop,
395 .bmdma_status = ata_bmdma_status,
396
397 .qc_prep = ata_qc_prep,
398 .qc_issue = ata_qc_issue_prot,
399
400 .data_xfer = ata_data_xfer_noirq, 351 .data_xfer = ata_data_xfer_noirq,
401
402 .irq_handler = ata_interrupt,
403 .irq_clear = ata_bmdma_irq_clear,
404 .irq_on = ata_irq_on,
405
406 .port_start = ata_sff_port_start,
407}; 352};
408 353
409/** 354/**
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c
index 9bafae9d5fe0..f235bb0d6139 100644
--- a/drivers/ata/pata_winbond.c
+++ b/drivers/ata/pata_winbond.c
@@ -126,29 +126,10 @@ static struct scsi_host_template winbond_sht = {
126}; 126};
127 127
128static struct ata_port_operations winbond_port_ops = { 128static struct ata_port_operations winbond_port_ops = {
129 .set_piomode = winbond_set_piomode, 129 .inherits = &ata_sff_port_ops,
130
131 .tf_load = ata_tf_load,
132 .tf_read = ata_tf_read,
133 .check_status = ata_check_status,
134 .exec_command = ata_exec_command,
135 .dev_select = ata_std_dev_select,
136
137 .freeze = ata_bmdma_freeze,
138 .thaw = ata_bmdma_thaw,
139 .error_handler = ata_bmdma_error_handler,
140 .post_internal_cmd = ata_bmdma_post_internal_cmd,
141 .cable_detect = ata_cable_40wire,
142
143 .qc_prep = ata_qc_prep,
144 .qc_issue = ata_qc_issue_prot,
145
146 .data_xfer = winbond_data_xfer, 130 .data_xfer = winbond_data_xfer,
147 131 .cable_detect = ata_cable_40wire,
148 .irq_clear = ata_noop_irq_clear, 132 .set_piomode = winbond_set_piomode,
149 .irq_on = ata_irq_on,
150
151 .port_start = ata_sff_port_start,
152}; 133};
153 134
154/** 135/**
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index fdf62de57cfc..a5706149af6b 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -148,26 +148,29 @@ static struct scsi_host_template adma_ata_sht = {
148 .dma_boundary = ADMA_DMA_BOUNDARY, 148 .dma_boundary = ADMA_DMA_BOUNDARY,
149}; 149};
150 150
151static const struct ata_port_operations adma_ata_ops = { 151static struct ata_port_operations adma_ata_ops = {
152 .inherits = &ata_base_port_ops,
153
154 .dev_select = ata_std_dev_select,
152 .tf_load = ata_tf_load, 155 .tf_load = ata_tf_load,
153 .tf_read = ata_tf_read, 156 .tf_read = ata_tf_read,
154 .exec_command = ata_exec_command,
155 .check_status = ata_check_status, 157 .check_status = ata_check_status,
156 .dev_select = ata_std_dev_select, 158 .exec_command = ata_exec_command,
157 .check_atapi_dma = adma_check_atapi_dma,
158 .data_xfer = ata_data_xfer, 159 .data_xfer = ata_data_xfer,
160 .check_atapi_dma = adma_check_atapi_dma,
161 .bmdma_stop = adma_bmdma_stop,
162 .bmdma_status = adma_bmdma_status,
159 .qc_prep = adma_qc_prep, 163 .qc_prep = adma_qc_prep,
160 .qc_issue = adma_qc_issue, 164 .qc_issue = adma_qc_issue,
165 .irq_on = ata_irq_on,
166
161 .freeze = adma_freeze, 167 .freeze = adma_freeze,
162 .thaw = adma_thaw, 168 .thaw = adma_thaw,
163 .error_handler = adma_error_handler, 169 .error_handler = adma_error_handler,
164 .irq_clear = ata_noop_irq_clear, 170
165 .irq_on = ata_irq_on,
166 .port_start = adma_port_start, 171 .port_start = adma_port_start,
167 .port_stop = adma_port_stop, 172 .port_stop = adma_port_stop,
168 .host_stop = adma_host_stop, 173 .host_stop = adma_host_stop,
169 .bmdma_stop = adma_bmdma_stop,
170 .bmdma_status = adma_bmdma_status,
171}; 174};
172 175
173static struct ata_port_info adma_port_info[] = { 176static struct ata_port_info adma_port_info[] = {
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index f50381b4ba06..865030ae8f8a 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1198,16 +1198,15 @@ static struct scsi_host_template sata_fsl_sht = {
1198}; 1198};
1199 1199
1200static const struct ata_port_operations sata_fsl_ops = { 1200static const struct ata_port_operations sata_fsl_ops = {
1201 .inherits = &sata_port_ops,
1202
1201 .check_status = sata_fsl_check_status, 1203 .check_status = sata_fsl_check_status,
1202 .check_altstatus = sata_fsl_check_status, 1204 .check_altstatus = sata_fsl_check_status,
1203 .dev_select = ata_noop_dev_select,
1204 1205
1205 .tf_read = sata_fsl_tf_read, 1206 .tf_read = sata_fsl_tf_read,
1206 1207
1207 .qc_defer = ata_std_qc_defer,
1208 .qc_prep = sata_fsl_qc_prep, 1208 .qc_prep = sata_fsl_qc_prep,
1209 .qc_issue = sata_fsl_qc_issue, 1209 .qc_issue = sata_fsl_qc_issue,
1210 .irq_clear = ata_noop_irq_clear,
1211 1210
1212 .scr_read = sata_fsl_scr_read, 1211 .scr_read = sata_fsl_scr_read,
1213 .scr_write = sata_fsl_scr_write, 1212 .scr_write = sata_fsl_scr_write,
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index bb853df865da..047f80f5825c 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -522,26 +522,13 @@ static int inic_port_start(struct ata_port *ap)
522} 522}
523 523
524static struct ata_port_operations inic_port_ops = { 524static struct ata_port_operations inic_port_ops = {
525 .tf_load = ata_tf_load, 525 .inherits = &ata_sff_port_ops,
526 .tf_read = ata_tf_read,
527 .check_status = ata_check_status,
528 .exec_command = ata_exec_command,
529 .dev_select = ata_std_dev_select,
530
531 .scr_read = inic_scr_read,
532 .scr_write = inic_scr_write,
533 526
534 .bmdma_setup = inic_bmdma_setup, 527 .bmdma_setup = inic_bmdma_setup,
535 .bmdma_start = inic_bmdma_start, 528 .bmdma_start = inic_bmdma_start,
536 .bmdma_stop = inic_bmdma_stop, 529 .bmdma_stop = inic_bmdma_stop,
537 .bmdma_status = inic_bmdma_status, 530 .bmdma_status = inic_bmdma_status,
538
539 .irq_clear = ata_noop_irq_clear,
540 .irq_on = ata_irq_on,
541
542 .qc_prep = ata_qc_prep,
543 .qc_issue = inic_qc_issue, 531 .qc_issue = inic_qc_issue,
544 .data_xfer = ata_data_xfer,
545 532
546 .freeze = inic_freeze, 533 .freeze = inic_freeze,
547 .thaw = inic_thaw, 534 .thaw = inic_thaw,
@@ -549,8 +536,10 @@ static struct ata_port_operations inic_port_ops = {
549 .post_internal_cmd = inic_post_internal_cmd, 536 .post_internal_cmd = inic_post_internal_cmd,
550 .dev_config = inic_dev_config, 537 .dev_config = inic_dev_config,
551 538
552 .port_resume = inic_port_resume, 539 .scr_read = inic_scr_read,
540 .scr_write = inic_scr_write,
553 541
542 .port_resume = inic_port_resume,
554 .port_start = inic_port_start, 543 .port_start = inic_port_start,
555}; 544};
556 545
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 52d41edadb72..f341a82d27bf 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -526,23 +526,16 @@ static struct scsi_host_template mv6_sht = {
526 .dma_boundary = MV_DMA_BOUNDARY, 526 .dma_boundary = MV_DMA_BOUNDARY,
527}; 527};
528 528
529static const struct ata_port_operations mv5_ops = { 529static struct ata_port_operations mv5_ops = {
530 .tf_load = ata_tf_load, 530 .inherits = &ata_sff_port_ops,
531 .tf_read = ata_tf_read,
532 .check_status = ata_check_status,
533 .exec_command = ata_exec_command,
534 .dev_select = ata_std_dev_select,
535 531
536 .qc_prep = mv_qc_prep, 532 .qc_prep = mv_qc_prep,
537 .qc_issue = mv_qc_issue, 533 .qc_issue = mv_qc_issue,
538 .data_xfer = ata_data_xfer,
539 534
540 .irq_clear = ata_noop_irq_clear,
541 .irq_on = ata_irq_on,
542
543 .error_handler = mv_error_handler,
544 .freeze = mv_eh_freeze, 535 .freeze = mv_eh_freeze,
545 .thaw = mv_eh_thaw, 536 .thaw = mv_eh_thaw,
537 .error_handler = mv_error_handler,
538 .post_internal_cmd = ATA_OP_NULL,
546 539
547 .scr_read = mv5_scr_read, 540 .scr_read = mv5_scr_read,
548 .scr_write = mv5_scr_write, 541 .scr_write = mv5_scr_write,
@@ -551,57 +544,18 @@ static const struct ata_port_operations mv5_ops = {
551 .port_stop = mv_port_stop, 544 .port_stop = mv_port_stop,
552}; 545};
553 546
554static const struct ata_port_operations mv6_ops = { 547static struct ata_port_operations mv6_ops = {
555 .dev_config = mv6_dev_config, 548 .inherits = &mv5_ops,
556 .tf_load = ata_tf_load,
557 .tf_read = ata_tf_read,
558 .check_status = ata_check_status,
559 .exec_command = ata_exec_command,
560 .dev_select = ata_std_dev_select,
561
562 .qc_prep = mv_qc_prep,
563 .qc_issue = mv_qc_issue,
564 .data_xfer = ata_data_xfer,
565
566 .irq_clear = ata_noop_irq_clear,
567 .irq_on = ata_irq_on,
568
569 .error_handler = mv_error_handler,
570 .freeze = mv_eh_freeze,
571 .thaw = mv_eh_thaw,
572 .qc_defer = ata_std_qc_defer, 549 .qc_defer = ata_std_qc_defer,
573 550 .dev_config = mv6_dev_config,
574 .scr_read = mv_scr_read, 551 .scr_read = mv_scr_read,
575 .scr_write = mv_scr_write, 552 .scr_write = mv_scr_write,
576
577 .port_start = mv_port_start,
578 .port_stop = mv_port_stop,
579}; 553};
580 554
581static const struct ata_port_operations mv_iie_ops = { 555static struct ata_port_operations mv_iie_ops = {
582 .tf_load = ata_tf_load, 556 .inherits = &mv6_ops,
583 .tf_read = ata_tf_read, 557 .dev_config = ATA_OP_NULL,
584 .check_status = ata_check_status,
585 .exec_command = ata_exec_command,
586 .dev_select = ata_std_dev_select,
587
588 .qc_prep = mv_qc_prep_iie, 558 .qc_prep = mv_qc_prep_iie,
589 .qc_issue = mv_qc_issue,
590 .data_xfer = ata_data_xfer,
591
592 .irq_clear = ata_noop_irq_clear,
593 .irq_on = ata_irq_on,
594
595 .error_handler = mv_error_handler,
596 .freeze = mv_eh_freeze,
597 .thaw = mv_eh_thaw,
598 .qc_defer = ata_std_qc_defer,
599
600 .scr_read = mv_scr_read,
601 .scr_write = mv_scr_write,
602
603 .port_start = mv_port_start,
604 .port_stop = mv_port_stop,
605}; 559};
606 560
607static const struct ata_port_info mv_port_info[] = { 561static const struct ata_port_info mv_port_info[] = {
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 9e2b4cef48f2..7b7ba0e26903 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -404,106 +404,41 @@ static struct scsi_host_template nv_swncq_sht = {
404 .slave_configure = nv_swncq_slave_config, 404 .slave_configure = nv_swncq_slave_config,
405}; 405};
406 406
407static const struct ata_port_operations nv_generic_ops = { 407static struct ata_port_operations nv_generic_ops = {
408 .tf_load = ata_tf_load, 408 .inherits = &ata_bmdma_port_ops,
409 .tf_read = ata_tf_read,
410 .exec_command = ata_exec_command,
411 .check_status = ata_check_status,
412 .dev_select = ata_std_dev_select,
413 .bmdma_setup = ata_bmdma_setup,
414 .bmdma_start = ata_bmdma_start,
415 .bmdma_stop = ata_bmdma_stop,
416 .bmdma_status = ata_bmdma_status,
417 .qc_prep = ata_qc_prep,
418 .qc_issue = ata_qc_issue_prot,
419 .mode_filter = ata_pci_default_filter,
420 .freeze = ata_bmdma_freeze,
421 .thaw = ata_bmdma_thaw,
422 .error_handler = nv_error_handler, 409 .error_handler = nv_error_handler,
423 .post_internal_cmd = ata_bmdma_post_internal_cmd,
424 .data_xfer = ata_data_xfer,
425 .irq_clear = ata_bmdma_irq_clear,
426 .irq_on = ata_irq_on,
427 .scr_read = nv_scr_read, 410 .scr_read = nv_scr_read,
428 .scr_write = nv_scr_write, 411 .scr_write = nv_scr_write,
429 .port_start = ata_sff_port_start,
430}; 412};
431 413
432static const struct ata_port_operations nv_nf2_ops = { 414static struct ata_port_operations nv_nf2_ops = {
433 .tf_load = ata_tf_load, 415 .inherits = &nv_generic_ops,
434 .tf_read = ata_tf_read,
435 .exec_command = ata_exec_command,
436 .check_status = ata_check_status,
437 .dev_select = ata_std_dev_select,
438 .bmdma_setup = ata_bmdma_setup,
439 .bmdma_start = ata_bmdma_start,
440 .bmdma_stop = ata_bmdma_stop,
441 .bmdma_status = ata_bmdma_status,
442 .qc_prep = ata_qc_prep,
443 .qc_issue = ata_qc_issue_prot,
444 .mode_filter = ata_pci_default_filter,
445 .freeze = nv_nf2_freeze, 416 .freeze = nv_nf2_freeze,
446 .thaw = nv_nf2_thaw, 417 .thaw = nv_nf2_thaw,
447 .error_handler = nv_error_handler,
448 .post_internal_cmd = ata_bmdma_post_internal_cmd,
449 .data_xfer = ata_data_xfer,
450 .irq_clear = ata_bmdma_irq_clear,
451 .irq_on = ata_irq_on,
452 .scr_read = nv_scr_read,
453 .scr_write = nv_scr_write,
454 .port_start = ata_sff_port_start,
455}; 418};
456 419
457static const struct ata_port_operations nv_ck804_ops = { 420static struct ata_port_operations nv_ck804_ops = {
458 .tf_load = ata_tf_load, 421 .inherits = &nv_generic_ops,
459 .tf_read = ata_tf_read,
460 .exec_command = ata_exec_command,
461 .check_status = ata_check_status,
462 .dev_select = ata_std_dev_select,
463 .bmdma_setup = ata_bmdma_setup,
464 .bmdma_start = ata_bmdma_start,
465 .bmdma_stop = ata_bmdma_stop,
466 .bmdma_status = ata_bmdma_status,
467 .qc_prep = ata_qc_prep,
468 .qc_issue = ata_qc_issue_prot,
469 .mode_filter = ata_pci_default_filter,
470 .freeze = nv_ck804_freeze, 422 .freeze = nv_ck804_freeze,
471 .thaw = nv_ck804_thaw, 423 .thaw = nv_ck804_thaw,
472 .error_handler = nv_error_handler,
473 .post_internal_cmd = ata_bmdma_post_internal_cmd,
474 .data_xfer = ata_data_xfer,
475 .irq_clear = ata_bmdma_irq_clear,
476 .irq_on = ata_irq_on,
477 .scr_read = nv_scr_read,
478 .scr_write = nv_scr_write,
479 .port_start = ata_sff_port_start,
480 .host_stop = nv_ck804_host_stop, 424 .host_stop = nv_ck804_host_stop,
481}; 425};
482 426
483static const struct ata_port_operations nv_adma_ops = { 427static struct ata_port_operations nv_adma_ops = {
484 .tf_load = ata_tf_load, 428 .inherits = &nv_generic_ops,
485 .tf_read = nv_adma_tf_read, 429
486 .check_atapi_dma = nv_adma_check_atapi_dma, 430 .check_atapi_dma = nv_adma_check_atapi_dma,
487 .exec_command = ata_exec_command, 431 .tf_read = nv_adma_tf_read,
488 .check_status = ata_check_status,
489 .dev_select = ata_std_dev_select,
490 .bmdma_setup = ata_bmdma_setup,
491 .bmdma_start = ata_bmdma_start,
492 .bmdma_stop = ata_bmdma_stop,
493 .bmdma_status = ata_bmdma_status,
494 .qc_defer = ata_std_qc_defer, 432 .qc_defer = ata_std_qc_defer,
495 .qc_prep = nv_adma_qc_prep, 433 .qc_prep = nv_adma_qc_prep,
496 .qc_issue = nv_adma_qc_issue, 434 .qc_issue = nv_adma_qc_issue,
497 .mode_filter = ata_pci_default_filter, 435 .irq_clear = nv_adma_irq_clear,
436
498 .freeze = nv_adma_freeze, 437 .freeze = nv_adma_freeze,
499 .thaw = nv_adma_thaw, 438 .thaw = nv_adma_thaw,
500 .error_handler = nv_adma_error_handler, 439 .error_handler = nv_adma_error_handler,
501 .post_internal_cmd = nv_adma_post_internal_cmd, 440 .post_internal_cmd = nv_adma_post_internal_cmd,
502 .data_xfer = ata_data_xfer, 441
503 .irq_clear = nv_adma_irq_clear,
504 .irq_on = ata_irq_on,
505 .scr_read = nv_scr_read,
506 .scr_write = nv_scr_write,
507 .port_start = nv_adma_port_start, 442 .port_start = nv_adma_port_start,
508 .port_stop = nv_adma_port_stop, 443 .port_stop = nv_adma_port_stop,
509#ifdef CONFIG_PM 444#ifdef CONFIG_PM
@@ -513,29 +448,17 @@ static const struct ata_port_operations nv_adma_ops = {
513 .host_stop = nv_adma_host_stop, 448 .host_stop = nv_adma_host_stop,
514}; 449};
515 450
516static const struct ata_port_operations nv_swncq_ops = { 451static struct ata_port_operations nv_swncq_ops = {
517 .tf_load = ata_tf_load, 452 .inherits = &nv_generic_ops,
518 .tf_read = ata_tf_read, 453
519 .exec_command = ata_exec_command,
520 .check_status = ata_check_status,
521 .dev_select = ata_std_dev_select,
522 .bmdma_setup = ata_bmdma_setup,
523 .bmdma_start = ata_bmdma_start,
524 .bmdma_stop = ata_bmdma_stop,
525 .bmdma_status = ata_bmdma_status,
526 .qc_defer = ata_std_qc_defer, 454 .qc_defer = ata_std_qc_defer,
527 .qc_prep = nv_swncq_qc_prep, 455 .qc_prep = nv_swncq_qc_prep,
528 .qc_issue = nv_swncq_qc_issue, 456 .qc_issue = nv_swncq_qc_issue,
529 .mode_filter = ata_pci_default_filter, 457
530 .freeze = nv_mcp55_freeze, 458 .freeze = nv_mcp55_freeze,
531 .thaw = nv_mcp55_thaw, 459 .thaw = nv_mcp55_thaw,
532 .error_handler = nv_swncq_error_handler, 460 .error_handler = nv_swncq_error_handler,
533 .post_internal_cmd = ata_bmdma_post_internal_cmd, 461
534 .data_xfer = ata_data_xfer,
535 .irq_clear = ata_bmdma_irq_clear,
536 .irq_on = ata_irq_on,
537 .scr_read = nv_scr_read,
538 .scr_write = nv_scr_write,
539#ifdef CONFIG_PM 462#ifdef CONFIG_PM
540 .port_suspend = nv_swncq_port_suspend, 463 .port_suspend = nv_swncq_port_suspend,
541 .port_resume = nv_swncq_port_resume, 464 .port_resume = nv_swncq_port_resume,
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 37c32ab3b23b..e09b975c973d 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -160,74 +160,42 @@ static struct scsi_host_template pdc_ata_sht = {
160 .dma_boundary = ATA_DMA_BOUNDARY, 160 .dma_boundary = ATA_DMA_BOUNDARY,
161}; 161};
162 162
163static const struct ata_port_operations pdc_sata_ops = { 163static const struct ata_port_operations pdc_common_ops = {
164 .inherits = &ata_sff_port_ops,
165
164 .tf_load = pdc_tf_load_mmio, 166 .tf_load = pdc_tf_load_mmio,
165 .tf_read = ata_tf_read,
166 .check_status = ata_check_status,
167 .exec_command = pdc_exec_command_mmio, 167 .exec_command = pdc_exec_command_mmio,
168 .dev_select = ata_std_dev_select,
169 .check_atapi_dma = pdc_check_atapi_dma, 168 .check_atapi_dma = pdc_check_atapi_dma,
170
171 .qc_prep = pdc_qc_prep, 169 .qc_prep = pdc_qc_prep,
172 .qc_issue = pdc_qc_issue_prot, 170 .qc_issue = pdc_qc_issue_prot,
173 .freeze = pdc_sata_freeze,
174 .thaw = pdc_sata_thaw,
175 .error_handler = pdc_sata_error_handler,
176 .post_internal_cmd = pdc_post_internal_cmd,
177 .cable_detect = pdc_sata_cable_detect,
178 .data_xfer = ata_data_xfer,
179 .irq_clear = pdc_irq_clear, 171 .irq_clear = pdc_irq_clear,
180 .irq_on = ata_irq_on,
181 172
182 .scr_read = pdc_sata_scr_read, 173 .post_internal_cmd = pdc_post_internal_cmd,
183 .scr_write = pdc_sata_scr_write,
184 .port_start = pdc_sata_port_start,
185}; 174};
186 175
187/* First-generation chips need a more restrictive ->check_atapi_dma op */ 176static struct ata_port_operations pdc_sata_ops = {
188static const struct ata_port_operations pdc_old_sata_ops = { 177 .inherits = &pdc_common_ops,
189 .tf_load = pdc_tf_load_mmio, 178 .cable_detect = pdc_sata_cable_detect,
190 .tf_read = ata_tf_read,
191 .check_status = ata_check_status,
192 .exec_command = pdc_exec_command_mmio,
193 .dev_select = ata_std_dev_select,
194 .check_atapi_dma = pdc_old_sata_check_atapi_dma,
195
196 .qc_prep = pdc_qc_prep,
197 .qc_issue = pdc_qc_issue_prot,
198 .freeze = pdc_sata_freeze, 179 .freeze = pdc_sata_freeze,
199 .thaw = pdc_sata_thaw, 180 .thaw = pdc_sata_thaw,
200 .error_handler = pdc_sata_error_handler, 181 .error_handler = pdc_sata_error_handler,
201 .post_internal_cmd = pdc_post_internal_cmd,
202 .cable_detect = pdc_sata_cable_detect,
203 .data_xfer = ata_data_xfer,
204 .irq_clear = pdc_irq_clear,
205 .irq_on = ata_irq_on,
206
207 .scr_read = pdc_sata_scr_read, 182 .scr_read = pdc_sata_scr_read,
208 .scr_write = pdc_sata_scr_write, 183 .scr_write = pdc_sata_scr_write,
209 .port_start = pdc_sata_port_start, 184 .port_start = pdc_sata_port_start,
210}; 185};
211 186
212static const struct ata_port_operations pdc_pata_ops = { 187/* First-generation chips need a more restrictive ->check_atapi_dma op */
213 .tf_load = pdc_tf_load_mmio, 188static struct ata_port_operations pdc_old_sata_ops = {
214 .tf_read = ata_tf_read, 189 .inherits = &pdc_sata_ops,
215 .check_status = ata_check_status, 190 .check_atapi_dma = pdc_old_sata_check_atapi_dma,
216 .exec_command = pdc_exec_command_mmio, 191};
217 .dev_select = ata_std_dev_select,
218 .check_atapi_dma = pdc_check_atapi_dma,
219 192
220 .qc_prep = pdc_qc_prep, 193static struct ata_port_operations pdc_pata_ops = {
221 .qc_issue = pdc_qc_issue_prot, 194 .inherits = &pdc_common_ops,
195 .cable_detect = pdc_pata_cable_detect,
222 .freeze = pdc_freeze, 196 .freeze = pdc_freeze,
223 .thaw = pdc_thaw, 197 .thaw = pdc_thaw,
224 .error_handler = pdc_pata_error_handler, 198 .error_handler = pdc_pata_error_handler,
225 .post_internal_cmd = pdc_post_internal_cmd,
226 .cable_detect = pdc_pata_cable_detect,
227 .data_xfer = ata_data_xfer,
228 .irq_clear = pdc_irq_clear,
229 .irq_on = ata_irq_on,
230
231 .port_start = pdc_common_port_start, 199 .port_start = pdc_common_port_start,
232}; 200};
233 201
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index 2566d0926aab..107ef09814de 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -131,27 +131,25 @@ static struct scsi_host_template qs_ata_sht = {
131 .dma_boundary = QS_DMA_BOUNDARY, 131 .dma_boundary = QS_DMA_BOUNDARY,
132}; 132};
133 133
134static const struct ata_port_operations qs_ata_ops = { 134static struct ata_port_operations qs_ata_ops = {
135 .tf_load = ata_tf_load, 135 .inherits = &ata_sff_port_ops,
136 .tf_read = ata_tf_read, 136
137 .check_status = ata_check_status,
138 .check_atapi_dma = qs_check_atapi_dma, 137 .check_atapi_dma = qs_check_atapi_dma,
139 .exec_command = ata_exec_command, 138 .bmdma_stop = qs_bmdma_stop,
140 .dev_select = ata_std_dev_select, 139 .bmdma_status = qs_bmdma_status,
141 .qc_prep = qs_qc_prep, 140 .qc_prep = qs_qc_prep,
142 .qc_issue = qs_qc_issue, 141 .qc_issue = qs_qc_issue,
143 .data_xfer = ata_data_xfer, 142
144 .freeze = qs_freeze, 143 .freeze = qs_freeze,
145 .thaw = qs_thaw, 144 .thaw = qs_thaw,
146 .error_handler = qs_error_handler, 145 .error_handler = qs_error_handler,
147 .irq_clear = ata_noop_irq_clear, 146 .post_internal_cmd = ATA_OP_NULL,
148 .irq_on = ata_irq_on, 147
149 .scr_read = qs_scr_read, 148 .scr_read = qs_scr_read,
150 .scr_write = qs_scr_write, 149 .scr_write = qs_scr_write,
150
151 .port_start = qs_port_start, 151 .port_start = qs_port_start,
152 .host_stop = qs_host_stop, 152 .host_stop = qs_host_stop,
153 .bmdma_stop = qs_bmdma_stop,
154 .bmdma_status = qs_bmdma_status,
155}; 153};
156 154
157static const struct ata_port_info qs_port_info[] = { 155static const struct ata_port_info qs_port_info[] = {
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index 738c1a8ae3b6..eac7ca73cfa0 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -170,31 +170,14 @@ static struct scsi_host_template sil_sht = {
170 ATA_BMDMA_SHT(DRV_NAME), 170 ATA_BMDMA_SHT(DRV_NAME),
171}; 171};
172 172
173static const struct ata_port_operations sil_ops = { 173static struct ata_port_operations sil_ops = {
174 .inherits = &ata_bmdma_port_ops,
174 .dev_config = sil_dev_config, 175 .dev_config = sil_dev_config,
175 .tf_load = ata_tf_load,
176 .tf_read = ata_tf_read,
177 .check_status = ata_check_status,
178 .exec_command = ata_exec_command,
179 .dev_select = ata_std_dev_select,
180 .set_mode = sil_set_mode, 176 .set_mode = sil_set_mode,
181 .mode_filter = ata_pci_default_filter,
182 .bmdma_setup = ata_bmdma_setup,
183 .bmdma_start = ata_bmdma_start,
184 .bmdma_stop = ata_bmdma_stop,
185 .bmdma_status = ata_bmdma_status,
186 .qc_prep = ata_qc_prep,
187 .qc_issue = ata_qc_issue_prot,
188 .data_xfer = ata_data_xfer,
189 .freeze = sil_freeze, 177 .freeze = sil_freeze,
190 .thaw = sil_thaw, 178 .thaw = sil_thaw,
191 .error_handler = ata_bmdma_error_handler,
192 .post_internal_cmd = ata_bmdma_post_internal_cmd,
193 .irq_clear = ata_bmdma_irq_clear,
194 .irq_on = ata_irq_on,
195 .scr_read = sil_scr_read, 179 .scr_read = sil_scr_read,
196 .scr_write = sil_scr_write, 180 .scr_write = sil_scr_write,
197 .port_start = ata_sff_port_start,
198}; 181};
199 182
200static const struct ata_port_info sil_port_info[] = { 183static const struct ata_port_info sil_port_info[] = {
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 7fa63950d81a..363fb90e1047 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -390,34 +390,28 @@ static struct scsi_host_template sil24_sht = {
390 .dma_boundary = ATA_DMA_BOUNDARY, 390 .dma_boundary = ATA_DMA_BOUNDARY,
391}; 391};
392 392
393static const struct ata_port_operations sil24_ops = { 393static struct ata_port_operations sil24_ops = {
394 .dev_config = sil24_dev_config, 394 .inherits = &sata_pmp_port_ops,
395 395
396 .check_status = sil24_check_status, 396 .check_status = sil24_check_status,
397 .check_altstatus = sil24_check_status, 397 .check_altstatus = sil24_check_status,
398 .dev_select = ata_noop_dev_select,
399
400 .tf_read = sil24_tf_read, 398 .tf_read = sil24_tf_read,
401
402 .qc_defer = sil24_qc_defer, 399 .qc_defer = sil24_qc_defer,
403 .qc_prep = sil24_qc_prep, 400 .qc_prep = sil24_qc_prep,
404 .qc_issue = sil24_qc_issue, 401 .qc_issue = sil24_qc_issue,
405 402
406 .irq_clear = ata_noop_irq_clear, 403 .freeze = sil24_freeze,
404 .thaw = sil24_thaw,
405 .error_handler = sil24_error_handler,
406 .post_internal_cmd = sil24_post_internal_cmd,
407 .dev_config = sil24_dev_config,
407 408
408 .scr_read = sil24_scr_read, 409 .scr_read = sil24_scr_read,
409 .scr_write = sil24_scr_write, 410 .scr_write = sil24_scr_write,
410
411 .pmp_attach = sil24_pmp_attach, 411 .pmp_attach = sil24_pmp_attach,
412 .pmp_detach = sil24_pmp_detach, 412 .pmp_detach = sil24_pmp_detach,
413 413
414 .freeze = sil24_freeze,
415 .thaw = sil24_thaw,
416 .error_handler = sil24_error_handler,
417 .post_internal_cmd = sil24_post_internal_cmd,
418
419 .port_start = sil24_port_start, 414 .port_start = sil24_port_start,
420
421#ifdef CONFIG_PM 415#ifdef CONFIG_PM
422 .port_resume = sil24_port_resume, 416 .port_resume = sil24_port_resume,
423#endif 417#endif
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 4becb7fde5e7..9089c7ab5000 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -89,29 +89,10 @@ static struct scsi_host_template sis_sht = {
89 ATA_BMDMA_SHT(DRV_NAME), 89 ATA_BMDMA_SHT(DRV_NAME),
90}; 90};
91 91
92static const struct ata_port_operations sis_ops = { 92static struct ata_port_operations sis_ops = {
93 .tf_load = ata_tf_load, 93 .inherits = &ata_bmdma_port_ops,
94 .tf_read = ata_tf_read,
95 .check_status = ata_check_status,
96 .exec_command = ata_exec_command,
97 .dev_select = ata_std_dev_select,
98 .bmdma_setup = ata_bmdma_setup,
99 .bmdma_start = ata_bmdma_start,
100 .bmdma_stop = ata_bmdma_stop,
101 .bmdma_status = ata_bmdma_status,
102 .qc_prep = ata_qc_prep,
103 .qc_issue = ata_qc_issue_prot,
104 .data_xfer = ata_data_xfer,
105 .mode_filter = ata_pci_default_filter,
106 .freeze = ata_bmdma_freeze,
107 .thaw = ata_bmdma_thaw,
108 .error_handler = ata_bmdma_error_handler,
109 .post_internal_cmd = ata_bmdma_post_internal_cmd,
110 .irq_clear = ata_bmdma_irq_clear,
111 .irq_on = ata_irq_on,
112 .scr_read = sis_scr_read, 94 .scr_read = sis_scr_read,
113 .scr_write = sis_scr_write, 95 .scr_write = sis_scr_write,
114 .port_start = ata_sff_port_start,
115}; 96};
116 97
117static const struct ata_port_info sis_port_info = { 98static const struct ata_port_info sis_port_info = {
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index c8768396e006..8636f164256e 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -334,30 +334,16 @@ static struct scsi_host_template k2_sata_sht = {
334}; 334};
335 335
336 336
337static const struct ata_port_operations k2_sata_ops = { 337static struct ata_port_operations k2_sata_ops = {
338 .inherits = &ata_bmdma_port_ops,
338 .tf_load = k2_sata_tf_load, 339 .tf_load = k2_sata_tf_load,
339 .tf_read = k2_sata_tf_read, 340 .tf_read = k2_sata_tf_read,
340 .check_status = k2_stat_check_status, 341 .check_status = k2_stat_check_status,
341 .exec_command = ata_exec_command,
342 .dev_select = ata_std_dev_select,
343 .check_atapi_dma = k2_sata_check_atapi_dma, 342 .check_atapi_dma = k2_sata_check_atapi_dma,
344 .bmdma_setup = k2_bmdma_setup_mmio, 343 .bmdma_setup = k2_bmdma_setup_mmio,
345 .bmdma_start = k2_bmdma_start_mmio, 344 .bmdma_start = k2_bmdma_start_mmio,
346 .bmdma_stop = ata_bmdma_stop,
347 .bmdma_status = ata_bmdma_status,
348 .qc_prep = ata_qc_prep,
349 .qc_issue = ata_qc_issue_prot,
350 .data_xfer = ata_data_xfer,
351 .mode_filter = ata_pci_default_filter,
352 .freeze = ata_bmdma_freeze,
353 .thaw = ata_bmdma_thaw,
354 .error_handler = ata_bmdma_error_handler,
355 .post_internal_cmd = ata_bmdma_post_internal_cmd,
356 .irq_clear = ata_bmdma_irq_clear,
357 .irq_on = ata_irq_on,
358 .scr_read = k2_sata_scr_read, 345 .scr_read = k2_sata_scr_read,
359 .scr_write = k2_sata_scr_write, 346 .scr_write = k2_sata_scr_write,
360 .port_start = ata_sff_port_start,
361}; 347};
362 348
363static const struct ata_port_info k2_port_info[] = { 349static const struct ata_port_info k2_port_info[] = {
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index 1802f92180e4..8138cda86a66 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -241,7 +241,8 @@ static struct scsi_host_template pdc_sata_sht = {
241 .dma_boundary = ATA_DMA_BOUNDARY, 241 .dma_boundary = ATA_DMA_BOUNDARY,
242}; 242};
243 243
244static const struct ata_port_operations pdc_20621_ops = { 244/* TODO: inherit from base port_ops after converting to new EH */
245static struct ata_port_operations pdc_20621_ops = {
245 .tf_load = pdc_tf_load_mmio, 246 .tf_load = pdc_tf_load_mmio,
246 .tf_read = ata_tf_read, 247 .tf_read = ata_tf_read,
247 .check_status = ata_check_status, 248 .check_status = ata_check_status,
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c
index 764d7064fa59..6ecd13fefa1a 100644
--- a/drivers/ata/sata_uli.c
+++ b/drivers/ata/sata_uli.c
@@ -79,34 +79,10 @@ static struct scsi_host_template uli_sht = {
79 ATA_BMDMA_SHT(DRV_NAME), 79 ATA_BMDMA_SHT(DRV_NAME),
80}; 80};
81 81
82static const struct ata_port_operations uli_ops = { 82static struct ata_port_operations uli_ops = {
83 .tf_load = ata_tf_load, 83 .inherits = &ata_bmdma_port_ops,
84 .tf_read = ata_tf_read,
85 .check_status = ata_check_status,
86 .exec_command = ata_exec_command,
87 .dev_select = ata_std_dev_select,
88
89 .bmdma_setup = ata_bmdma_setup,
90 .bmdma_start = ata_bmdma_start,
91 .bmdma_stop = ata_bmdma_stop,
92 .bmdma_status = ata_bmdma_status,
93 .qc_prep = ata_qc_prep,
94 .qc_issue = ata_qc_issue_prot,
95 .data_xfer = ata_data_xfer,
96
97 .mode_filter = ata_pci_default_filter,
98 .freeze = ata_bmdma_freeze,
99 .thaw = ata_bmdma_thaw,
100 .error_handler = ata_bmdma_error_handler,
101 .post_internal_cmd = ata_bmdma_post_internal_cmd,
102
103 .irq_clear = ata_bmdma_irq_clear,
104 .irq_on = ata_irq_on,
105
106 .scr_read = uli_scr_read, 84 .scr_read = uli_scr_read,
107 .scr_write = uli_scr_write, 85 .scr_write = uli_scr_write,
108
109 .port_start = ata_sff_port_start,
110}; 86};
111 87
112static const struct ata_port_info uli_port_info = { 88static const struct ata_port_info uli_port_info = {
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index 9be877cb7f57..6326bcf8ea5d 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -103,97 +103,23 @@ static struct scsi_host_template svia_sht = {
103 ATA_BMDMA_SHT(DRV_NAME), 103 ATA_BMDMA_SHT(DRV_NAME),
104}; 104};
105 105
106static const struct ata_port_operations vt6420_sata_ops = { 106static struct ata_port_operations vt6420_sata_ops = {
107 .mode_filter = ata_pci_default_filter, 107 .inherits = &ata_bmdma_port_ops,
108
109 .tf_load = ata_tf_load,
110 .tf_read = ata_tf_read,
111 .check_status = ata_check_status,
112 .exec_command = ata_exec_command,
113 .dev_select = ata_std_dev_select,
114
115 .bmdma_setup = ata_bmdma_setup,
116 .bmdma_start = ata_bmdma_start,
117 .bmdma_stop = ata_bmdma_stop,
118 .bmdma_status = ata_bmdma_status,
119
120 .qc_prep = ata_qc_prep,
121 .qc_issue = ata_qc_issue_prot,
122 .data_xfer = ata_data_xfer,
123
124 .freeze = svia_noop_freeze, 108 .freeze = svia_noop_freeze,
125 .thaw = ata_bmdma_thaw,
126 .error_handler = vt6420_error_handler, 109 .error_handler = vt6420_error_handler,
127 .post_internal_cmd = ata_bmdma_post_internal_cmd,
128
129 .irq_clear = ata_bmdma_irq_clear,
130 .irq_on = ata_irq_on,
131
132 .port_start = ata_sff_port_start,
133}; 110};
134 111
135static const struct ata_port_operations vt6421_pata_ops = { 112static struct ata_port_operations vt6421_pata_ops = {
113 .inherits = &ata_bmdma_port_ops,
114 .cable_detect = vt6421_pata_cable_detect,
136 .set_piomode = vt6421_set_pio_mode, 115 .set_piomode = vt6421_set_pio_mode,
137 .set_dmamode = vt6421_set_dma_mode, 116 .set_dmamode = vt6421_set_dma_mode,
138 .mode_filter = ata_pci_default_filter,
139
140 .tf_load = ata_tf_load,
141 .tf_read = ata_tf_read,
142 .check_status = ata_check_status,
143 .exec_command = ata_exec_command,
144 .dev_select = ata_std_dev_select,
145
146 .bmdma_setup = ata_bmdma_setup,
147 .bmdma_start = ata_bmdma_start,
148 .bmdma_stop = ata_bmdma_stop,
149 .bmdma_status = ata_bmdma_status,
150
151 .qc_prep = ata_qc_prep,
152 .qc_issue = ata_qc_issue_prot,
153 .data_xfer = ata_data_xfer,
154
155 .freeze = ata_bmdma_freeze,
156 .thaw = ata_bmdma_thaw,
157 .error_handler = ata_bmdma_error_handler,
158 .post_internal_cmd = ata_bmdma_post_internal_cmd,
159 .cable_detect = vt6421_pata_cable_detect,
160
161 .irq_clear = ata_bmdma_irq_clear,
162 .irq_on = ata_irq_on,
163
164 .port_start = ata_sff_port_start,
165}; 117};
166 118
167static const struct ata_port_operations vt6421_sata_ops = { 119static struct ata_port_operations vt6421_sata_ops = {
168 .mode_filter = ata_pci_default_filter, 120 .inherits = &ata_bmdma_port_ops,
169
170 .tf_load = ata_tf_load,
171 .tf_read = ata_tf_read,
172 .check_status = ata_check_status,
173 .exec_command = ata_exec_command,
174 .dev_select = ata_std_dev_select,
175
176 .bmdma_setup = ata_bmdma_setup,
177 .bmdma_start = ata_bmdma_start,
178 .bmdma_stop = ata_bmdma_stop,
179 .bmdma_status = ata_bmdma_status,
180
181 .qc_prep = ata_qc_prep,
182 .qc_issue = ata_qc_issue_prot,
183 .data_xfer = ata_data_xfer,
184
185 .freeze = ata_bmdma_freeze,
186 .thaw = ata_bmdma_thaw,
187 .error_handler = ata_bmdma_error_handler,
188 .post_internal_cmd = ata_bmdma_post_internal_cmd,
189
190 .irq_clear = ata_bmdma_irq_clear,
191 .irq_on = ata_irq_on,
192
193 .scr_read = svia_scr_read, 121 .scr_read = svia_scr_read,
194 .scr_write = svia_scr_write, 122 .scr_write = svia_scr_write,
195
196 .port_start = ata_sff_port_start,
197}; 123};
198 124
199static const struct ata_port_info vt6420_port_info = { 125static const struct ata_port_info vt6420_port_info = {
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c
index fd6855f0bf48..8045a72dc559 100644
--- a/drivers/ata/sata_vsc.c
+++ b/drivers/ata/sata_vsc.c
@@ -304,29 +304,14 @@ static struct scsi_host_template vsc_sata_sht = {
304}; 304};
305 305
306 306
307static const struct ata_port_operations vsc_sata_ops = { 307static struct ata_port_operations vsc_sata_ops = {
308 .inherits = &ata_bmdma_port_ops,
308 .tf_load = vsc_sata_tf_load, 309 .tf_load = vsc_sata_tf_load,
309 .tf_read = vsc_sata_tf_read, 310 .tf_read = vsc_sata_tf_read,
310 .exec_command = ata_exec_command,
311 .check_status = ata_check_status,
312 .dev_select = ata_std_dev_select,
313 .bmdma_setup = ata_bmdma_setup,
314 .bmdma_start = ata_bmdma_start,
315 .bmdma_stop = ata_bmdma_stop,
316 .bmdma_status = ata_bmdma_status,
317 .qc_prep = ata_qc_prep,
318 .qc_issue = ata_qc_issue_prot,
319 .data_xfer = ata_data_xfer,
320 .mode_filter = ata_pci_default_filter,
321 .freeze = vsc_freeze, 311 .freeze = vsc_freeze,
322 .thaw = vsc_thaw, 312 .thaw = vsc_thaw,
323 .error_handler = ata_bmdma_error_handler,
324 .post_internal_cmd = ata_bmdma_post_internal_cmd,
325 .irq_clear = ata_bmdma_irq_clear,
326 .irq_on = ata_irq_on,
327 .scr_read = vsc_sata_scr_read, 313 .scr_read = vsc_sata_scr_read,
328 .scr_write = vsc_sata_scr_write, 314 .scr_write = vsc_sata_scr_write,
329 .port_start = ata_sff_port_start,
330}; 315};
331 316
332static void __devinit vsc_sata_setup_port(struct ata_ioports *port, 317static void __devinit vsc_sata_setup_port(struct ata_ioports *port,