diff options
author | Tejun Heo <tj@kernel.org> | 2010-05-10 15:41:33 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2010-05-19 13:31:29 -0400 |
commit | 8930ff254a3a80d4477c3391ade07d6dd2a036c7 (patch) | |
tree | 2c83672d48fbe306d6968f9f54b0d80fb736d5f9 /drivers | |
parent | 9f2f72107ff621fdf3066e5a1b5ecb03ee587ebc (diff) |
libata-sff: clean up inheritance in several drivers
1. pata_cmd640 is PIO only. Inherit from sff.
2. pata_macio is BMDMA. Inherit from bmdma and drop explicit
bmdma_mode_filter() setting.
3. In sata_mv, unlike mv5, mv6 is BMDMA. Inherit from bmdma and
don't clear ->post_internal_cmd().
4. bf54x and icside are quasi-BMDMA controllers which don't use the
standard BMDMA registers so they don't initialize bmdma_addr and
inherit from sff to avoid the default mode_filter which disables
DMA modes if bmdma_addr is not initialized.
For 2 and 3, this patch makes the drivers explicitly specify
->mode_filter to ATA_OP_NULL while inheriting from ata_bmdma_port_ops.
These will be removed by the next patch.
This patch makes all and only BMDMA drivers inherit from
ata_bmdma_port_ops to ease further SFF/BMDMA separation.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/pata_bf54x.c | 4 | ||||
-rw-r--r-- | drivers/ata/pata_cmd640.c | 4 | ||||
-rw-r--r-- | drivers/ata/pata_icside.c | 4 | ||||
-rw-r--r-- | drivers/ata/pata_macio.c | 3 | ||||
-rw-r--r-- | drivers/ata/sata_mv.c | 24 |
5 files changed, 29 insertions, 10 deletions
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c index e9bf44cf4142..3d94c800e9d1 100644 --- a/drivers/ata/pata_bf54x.c +++ b/drivers/ata/pata_bf54x.c | |||
@@ -1421,7 +1421,7 @@ static struct scsi_host_template bfin_sht = { | |||
1421 | }; | 1421 | }; |
1422 | 1422 | ||
1423 | static struct ata_port_operations bfin_pata_ops = { | 1423 | static struct ata_port_operations bfin_pata_ops = { |
1424 | .inherits = &ata_sff_port_ops, | 1424 | .inherits = &ata_bmdma_port_ops, |
1425 | 1425 | ||
1426 | .set_piomode = bfin_set_piomode, | 1426 | .set_piomode = bfin_set_piomode, |
1427 | .set_dmamode = bfin_set_dmamode, | 1427 | .set_dmamode = bfin_set_dmamode, |
@@ -1450,6 +1450,8 @@ static struct ata_port_operations bfin_pata_ops = { | |||
1450 | 1450 | ||
1451 | .port_start = bfin_port_start, | 1451 | .port_start = bfin_port_start, |
1452 | .port_stop = bfin_port_stop, | 1452 | .port_stop = bfin_port_stop, |
1453 | |||
1454 | .mode_filter = ATA_OP_NULL, /* will be removed soon */ | ||
1453 | }; | 1455 | }; |
1454 | 1456 | ||
1455 | static struct ata_port_info bfin_port_info[] = { | 1457 | static struct ata_port_info bfin_port_info[] = { |
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c index 7d2fac645b4c..60ab2d2b1ccd 100644 --- a/drivers/ata/pata_cmd640.c +++ b/drivers/ata/pata_cmd640.c | |||
@@ -166,11 +166,11 @@ static int cmd640_port_start(struct ata_port *ap) | |||
166 | } | 166 | } |
167 | 167 | ||
168 | static struct scsi_host_template cmd640_sht = { | 168 | static struct scsi_host_template cmd640_sht = { |
169 | ATA_BMDMA_SHT(DRV_NAME), | 169 | ATA_PIO_SHT(DRV_NAME), |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static struct ata_port_operations cmd640_port_ops = { | 172 | static struct ata_port_operations cmd640_port_ops = { |
173 | .inherits = &ata_bmdma_port_ops, | 173 | .inherits = &ata_sff_port_ops, |
174 | /* In theory xfer_noirq is not needed once we kill the prefetcher */ | 174 | /* In theory xfer_noirq is not needed once we kill the prefetcher */ |
175 | .sff_data_xfer = ata_sff_data_xfer_noirq, | 175 | .sff_data_xfer = ata_sff_data_xfer_noirq, |
176 | .qc_issue = cmd640_qc_issue, | 176 | .qc_issue = cmd640_qc_issue, |
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c index fa812e206eeb..832c8ccd0e80 100644 --- a/drivers/ata/pata_icside.c +++ b/drivers/ata/pata_icside.c | |||
@@ -321,7 +321,7 @@ static void pata_icside_postreset(struct ata_link *link, unsigned int *classes) | |||
321 | } | 321 | } |
322 | 322 | ||
323 | static struct ata_port_operations pata_icside_port_ops = { | 323 | static struct ata_port_operations pata_icside_port_ops = { |
324 | .inherits = &ata_sff_port_ops, | 324 | .inherits = &ata_bmdma_port_ops, |
325 | /* no need to build any PRD tables for DMA */ | 325 | /* no need to build any PRD tables for DMA */ |
326 | .qc_prep = ata_noop_qc_prep, | 326 | .qc_prep = ata_noop_qc_prep, |
327 | .sff_data_xfer = ata_sff_data_xfer_noirq, | 327 | .sff_data_xfer = ata_sff_data_xfer_noirq, |
@@ -334,6 +334,8 @@ static struct ata_port_operations pata_icside_port_ops = { | |||
334 | .set_dmamode = pata_icside_set_dmamode, | 334 | .set_dmamode = pata_icside_set_dmamode, |
335 | .postreset = pata_icside_postreset, | 335 | .postreset = pata_icside_postreset, |
336 | .post_internal_cmd = pata_icside_bmdma_stop, | 336 | .post_internal_cmd = pata_icside_bmdma_stop, |
337 | |||
338 | .mode_filter = ATA_OP_NULL, /* will be removed soon */ | ||
337 | }; | 339 | }; |
338 | 340 | ||
339 | static void __devinit | 341 | static void __devinit |
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c index 211b6438b3a0..17e4e5d19696 100644 --- a/drivers/ata/pata_macio.c +++ b/drivers/ata/pata_macio.c | |||
@@ -917,7 +917,7 @@ static struct scsi_host_template pata_macio_sht = { | |||
917 | }; | 917 | }; |
918 | 918 | ||
919 | static struct ata_port_operations pata_macio_ops = { | 919 | static struct ata_port_operations pata_macio_ops = { |
920 | .inherits = &ata_sff_port_ops, | 920 | .inherits = &ata_bmdma_port_ops, |
921 | 921 | ||
922 | .freeze = pata_macio_freeze, | 922 | .freeze = pata_macio_freeze, |
923 | .set_piomode = pata_macio_set_timings, | 923 | .set_piomode = pata_macio_set_timings, |
@@ -925,7 +925,6 @@ static struct ata_port_operations pata_macio_ops = { | |||
925 | .cable_detect = pata_macio_cable_detect, | 925 | .cable_detect = pata_macio_cable_detect, |
926 | .sff_dev_select = pata_macio_dev_select, | 926 | .sff_dev_select = pata_macio_dev_select, |
927 | .qc_prep = pata_macio_qc_prep, | 927 | .qc_prep = pata_macio_qc_prep, |
928 | .mode_filter = ata_bmdma_mode_filter, | ||
929 | .bmdma_setup = pata_macio_bmdma_setup, | 928 | .bmdma_setup = pata_macio_bmdma_setup, |
930 | .bmdma_start = pata_macio_bmdma_start, | 929 | .bmdma_start = pata_macio_bmdma_start, |
931 | .bmdma_stop = pata_macio_bmdma_stop, | 930 | .bmdma_stop = pata_macio_bmdma_stop, |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 318862e8a8a9..a03371075990 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -686,16 +686,27 @@ static struct ata_port_operations mv5_ops = { | |||
686 | }; | 686 | }; |
687 | 687 | ||
688 | static struct ata_port_operations mv6_ops = { | 688 | static struct ata_port_operations mv6_ops = { |
689 | .inherits = &mv5_ops, | 689 | .inherits = &ata_bmdma_port_ops, |
690 | |||
691 | .lost_interrupt = ATA_OP_NULL, | ||
692 | |||
693 | .qc_defer = mv_qc_defer, | ||
694 | .qc_prep = mv_qc_prep, | ||
695 | .qc_issue = mv_qc_issue, | ||
696 | |||
690 | .dev_config = mv6_dev_config, | 697 | .dev_config = mv6_dev_config, |
691 | .scr_read = mv_scr_read, | ||
692 | .scr_write = mv_scr_write, | ||
693 | 698 | ||
699 | .freeze = mv_eh_freeze, | ||
700 | .thaw = mv_eh_thaw, | ||
701 | .hardreset = mv_hardreset, | ||
702 | .softreset = mv_softreset, | ||
694 | .pmp_hardreset = mv_pmp_hardreset, | 703 | .pmp_hardreset = mv_pmp_hardreset, |
695 | .pmp_softreset = mv_softreset, | 704 | .pmp_softreset = mv_softreset, |
696 | .softreset = mv_softreset, | ||
697 | .error_handler = mv_pmp_error_handler, | 705 | .error_handler = mv_pmp_error_handler, |
698 | 706 | ||
707 | .scr_read = mv_scr_read, | ||
708 | .scr_write = mv_scr_write, | ||
709 | |||
699 | .sff_check_status = mv_sff_check_status, | 710 | .sff_check_status = mv_sff_check_status, |
700 | .sff_irq_clear = mv_sff_irq_clear, | 711 | .sff_irq_clear = mv_sff_irq_clear, |
701 | .check_atapi_dma = mv_check_atapi_dma, | 712 | .check_atapi_dma = mv_check_atapi_dma, |
@@ -703,6 +714,11 @@ static struct ata_port_operations mv6_ops = { | |||
703 | .bmdma_start = mv_bmdma_start, | 714 | .bmdma_start = mv_bmdma_start, |
704 | .bmdma_stop = mv_bmdma_stop, | 715 | .bmdma_stop = mv_bmdma_stop, |
705 | .bmdma_status = mv_bmdma_status, | 716 | .bmdma_status = mv_bmdma_status, |
717 | |||
718 | .port_start = mv_port_start, | ||
719 | .port_stop = mv_port_stop, | ||
720 | |||
721 | .mode_filter = ATA_OP_NULL, /* will be removed soon */ | ||
706 | }; | 722 | }; |
707 | 723 | ||
708 | static struct ata_port_operations mv_iie_ops = { | 724 | static struct ata_port_operations mv_iie_ops = { |