hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/ata/sata_promise.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * sata_promise.c - Promise SATA
34 *
....@@ -8,27 +9,10 @@
89 *
910 * Copyright 2003-2004 Red Hat, Inc.
1011 *
11
- *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License as published by
14
- * the Free Software Foundation; either version 2, or (at your option)
15
- * any later version.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with this program; see the file COPYING. If not, write to
24
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25
- *
26
- *
2712 * libata documentation is available via 'make {ps|pdf}docs',
2813 * as Documentation/driver-api/libata.rst
2914 *
3015 * Hardware information only available under NDA.
31
- *
3216 */
3317
3418 #include <linux/kernel.h>
....@@ -173,7 +157,6 @@
173157 static void pdc_error_handler(struct ata_port *ap);
174158 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc);
175159 static int pdc_pata_cable_detect(struct ata_port *ap);
176
-static int pdc_sata_cable_detect(struct ata_port *ap);
177160
178161 static struct scsi_host_template pdc_ata_sht = {
179162 ATA_BASE_SHT(DRV_NAME),
....@@ -199,7 +182,7 @@
199182
200183 static struct ata_port_operations pdc_sata_ops = {
201184 .inherits = &pdc_common_ops,
202
- .cable_detect = pdc_sata_cable_detect,
185
+ .cable_detect = ata_cable_sata,
203186 .freeze = pdc_sata_freeze,
204187 .thaw = pdc_sata_thaw,
205188 .scr_read = pdc_sata_scr_read,
....@@ -475,11 +458,6 @@
475458 return ATA_CBL_PATA80;
476459 }
477460
478
-static int pdc_sata_cable_detect(struct ata_port *ap)
479
-{
480
- return ATA_CBL_SATA;
481
-}
482
-
483461 static int pdc_sata_scr_read(struct ata_link *link,
484462 unsigned int sc_reg, u32 *val)
485463 {
....@@ -659,7 +637,7 @@
659637 switch (qc->tf.protocol) {
660638 case ATA_PROT_DMA:
661639 pdc_fill_sg(qc);
662
- /*FALLTHROUGH*/
640
+ fallthrough;
663641 case ATA_PROT_NODATA:
664642 i = pdc_pkt_header(&qc->tf, qc->ap->bmdma_prd_dma,
665643 qc->dev->devno, pp->pkt);
....@@ -674,7 +652,7 @@
674652 break;
675653 case ATAPI_PROT_DMA:
676654 pdc_fill_sg(qc);
677
- /*FALLTHROUGH*/
655
+ fallthrough;
678656 case ATAPI_PROT_NODATA:
679657 pdc_atapi_pkt(qc);
680658 break;
....@@ -1044,11 +1022,11 @@
10441022 case ATAPI_PROT_NODATA:
10451023 if (qc->dev->flags & ATA_DFLAG_CDB_INTR)
10461024 break;
1047
- /*FALLTHROUGH*/
1025
+ fallthrough;
10481026 case ATA_PROT_NODATA:
10491027 if (qc->tf.flags & ATA_TFLAG_POLLING)
10501028 break;
1051
- /*FALLTHROUGH*/
1029
+ fallthrough;
10521030 case ATAPI_PROT_DMA:
10531031 case ATA_PROT_DMA:
10541032 pdc_packet_start(qc);
....@@ -1248,10 +1226,7 @@
12481226 /* initialize adapter */
12491227 pdc_host_init(host);
12501228
1251
- rc = dma_set_mask(&pdev->dev, ATA_DMA_MASK);
1252
- if (rc)
1253
- return rc;
1254
- rc = dma_set_coherent_mask(&pdev->dev, ATA_DMA_MASK);
1229
+ rc = dma_set_mask_and_coherent(&pdev->dev, ATA_DMA_MASK);
12551230 if (rc)
12561231 return rc;
12571232