aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_sil24.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_sil24.c')
-rw-r--r--drivers/ata/sata_sil24.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 864c1c1b8511..fdd3ceac329b 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -852,9 +852,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc)
852 * set. 852 * set.
853 * 853 *
854 */ 854 */
855 int is_excl = (prot == ATA_PROT_ATAPI || 855 int is_excl = (ata_is_atapi(prot) ||
856 prot == ATA_PROT_ATAPI_NODATA ||
857 prot == ATA_PROT_ATAPI_DMA ||
858 (qc->flags & ATA_QCFLAG_RESULT_TF)); 856 (qc->flags & ATA_QCFLAG_RESULT_TF));
859 857
860 if (unlikely(ap->excl_link)) { 858 if (unlikely(ap->excl_link)) {
@@ -885,35 +883,21 @@ static void sil24_qc_prep(struct ata_queued_cmd *qc)
885 883
886 cb = &pp->cmd_block[sil24_tag(qc->tag)]; 884 cb = &pp->cmd_block[sil24_tag(qc->tag)];
887 885
888 switch (qc->tf.protocol) { 886 if (!ata_is_atapi(qc->tf.protocol)) {
889 case ATA_PROT_PIO:
890 case ATA_PROT_DMA:
891 case ATA_PROT_NCQ:
892 case ATA_PROT_NODATA:
893 prb = &cb->ata.prb; 887 prb = &cb->ata.prb;
894 sge = cb->ata.sge; 888 sge = cb->ata.sge;
895 break; 889 } else {
896
897 case ATA_PROT_ATAPI:
898 case ATA_PROT_ATAPI_DMA:
899 case ATA_PROT_ATAPI_NODATA:
900 prb = &cb->atapi.prb; 890 prb = &cb->atapi.prb;
901 sge = cb->atapi.sge; 891 sge = cb->atapi.sge;
902 memset(cb->atapi.cdb, 0, 32); 892 memset(cb->atapi.cdb, 0, 32);
903 memcpy(cb->atapi.cdb, qc->cdb, qc->dev->cdb_len); 893 memcpy(cb->atapi.cdb, qc->cdb, qc->dev->cdb_len);
904 894
905 if (qc->tf.protocol != ATA_PROT_ATAPI_NODATA) { 895 if (ata_is_data(qc->tf.protocol)) {
906 if (qc->tf.flags & ATA_TFLAG_WRITE) 896 if (qc->tf.flags & ATA_TFLAG_WRITE)
907 ctrl = PRB_CTRL_PACKET_WRITE; 897 ctrl = PRB_CTRL_PACKET_WRITE;
908 else 898 else
909 ctrl = PRB_CTRL_PACKET_READ; 899 ctrl = PRB_CTRL_PACKET_READ;
910 } 900 }
911 break;
912
913 default:
914 prb = NULL; /* shut up, gcc */
915 sge = NULL;
916 BUG();
917 } 901 }
918 902
919 prb->ctrl = cpu_to_le16(ctrl); 903 prb->ctrl = cpu_to_le16(ctrl);