| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * sata_promise.c - Promise SATA |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * Copyright 2003-2004 Red Hat, Inc. |
|---|
| 10 | 11 | * |
|---|
| 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 | | - * |
|---|
| 27 | 12 | * libata documentation is available via 'make {ps|pdf}docs', |
|---|
| 28 | 13 | * as Documentation/driver-api/libata.rst |
|---|
| 29 | 14 | * |
|---|
| 30 | 15 | * Hardware information only available under NDA. |
|---|
| 31 | | - * |
|---|
| 32 | 16 | */ |
|---|
| 33 | 17 | |
|---|
| 34 | 18 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 173 | 157 | static void pdc_error_handler(struct ata_port *ap); |
|---|
| 174 | 158 | static void pdc_post_internal_cmd(struct ata_queued_cmd *qc); |
|---|
| 175 | 159 | static int pdc_pata_cable_detect(struct ata_port *ap); |
|---|
| 176 | | -static int pdc_sata_cable_detect(struct ata_port *ap); |
|---|
| 177 | 160 | |
|---|
| 178 | 161 | static struct scsi_host_template pdc_ata_sht = { |
|---|
| 179 | 162 | ATA_BASE_SHT(DRV_NAME), |
|---|
| .. | .. |
|---|
| 199 | 182 | |
|---|
| 200 | 183 | static struct ata_port_operations pdc_sata_ops = { |
|---|
| 201 | 184 | .inherits = &pdc_common_ops, |
|---|
| 202 | | - .cable_detect = pdc_sata_cable_detect, |
|---|
| 185 | + .cable_detect = ata_cable_sata, |
|---|
| 203 | 186 | .freeze = pdc_sata_freeze, |
|---|
| 204 | 187 | .thaw = pdc_sata_thaw, |
|---|
| 205 | 188 | .scr_read = pdc_sata_scr_read, |
|---|
| .. | .. |
|---|
| 475 | 458 | return ATA_CBL_PATA80; |
|---|
| 476 | 459 | } |
|---|
| 477 | 460 | |
|---|
| 478 | | -static int pdc_sata_cable_detect(struct ata_port *ap) |
|---|
| 479 | | -{ |
|---|
| 480 | | - return ATA_CBL_SATA; |
|---|
| 481 | | -} |
|---|
| 482 | | - |
|---|
| 483 | 461 | static int pdc_sata_scr_read(struct ata_link *link, |
|---|
| 484 | 462 | unsigned int sc_reg, u32 *val) |
|---|
| 485 | 463 | { |
|---|
| .. | .. |
|---|
| 659 | 637 | switch (qc->tf.protocol) { |
|---|
| 660 | 638 | case ATA_PROT_DMA: |
|---|
| 661 | 639 | pdc_fill_sg(qc); |
|---|
| 662 | | - /*FALLTHROUGH*/ |
|---|
| 640 | + fallthrough; |
|---|
| 663 | 641 | case ATA_PROT_NODATA: |
|---|
| 664 | 642 | i = pdc_pkt_header(&qc->tf, qc->ap->bmdma_prd_dma, |
|---|
| 665 | 643 | qc->dev->devno, pp->pkt); |
|---|
| .. | .. |
|---|
| 674 | 652 | break; |
|---|
| 675 | 653 | case ATAPI_PROT_DMA: |
|---|
| 676 | 654 | pdc_fill_sg(qc); |
|---|
| 677 | | - /*FALLTHROUGH*/ |
|---|
| 655 | + fallthrough; |
|---|
| 678 | 656 | case ATAPI_PROT_NODATA: |
|---|
| 679 | 657 | pdc_atapi_pkt(qc); |
|---|
| 680 | 658 | break; |
|---|
| .. | .. |
|---|
| 1044 | 1022 | case ATAPI_PROT_NODATA: |
|---|
| 1045 | 1023 | if (qc->dev->flags & ATA_DFLAG_CDB_INTR) |
|---|
| 1046 | 1024 | break; |
|---|
| 1047 | | - /*FALLTHROUGH*/ |
|---|
| 1025 | + fallthrough; |
|---|
| 1048 | 1026 | case ATA_PROT_NODATA: |
|---|
| 1049 | 1027 | if (qc->tf.flags & ATA_TFLAG_POLLING) |
|---|
| 1050 | 1028 | break; |
|---|
| 1051 | | - /*FALLTHROUGH*/ |
|---|
| 1029 | + fallthrough; |
|---|
| 1052 | 1030 | case ATAPI_PROT_DMA: |
|---|
| 1053 | 1031 | case ATA_PROT_DMA: |
|---|
| 1054 | 1032 | pdc_packet_start(qc); |
|---|
| .. | .. |
|---|
| 1248 | 1226 | /* initialize adapter */ |
|---|
| 1249 | 1227 | pdc_host_init(host); |
|---|
| 1250 | 1228 | |
|---|
| 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); |
|---|
| 1255 | 1230 | if (rc) |
|---|
| 1256 | 1231 | return rc; |
|---|
| 1257 | 1232 | |
|---|