forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/ata/libata-sff.c
....@@ -1,35 +1,15 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * libata-sff.c - helper library for PCI IDE BMDMA
34 *
4
- * Maintained by: Tejun Heo <tj@kernel.org>
5
- * Please ALWAYS copy linux-ide@vger.kernel.org
6
- * on emails.
7
- *
85 * Copyright 2003-2006 Red Hat, Inc. All rights reserved.
96 * Copyright 2003-2006 Jeff Garzik
10
- *
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
- *
267 *
278 * libata documentation is available via 'make {ps|pdf}docs',
289 * as Documentation/driver-api/libata.rst
2910 *
3011 * Hardware documentation available from http://www.t13.org/ and
3112 * http://www.sata-io.org/
32
- *
3313 */
3414
3515 #include <linux/kernel.h>
....@@ -3192,15 +3172,9 @@
31923172 * ->sff_irq_clear method. Try to initialize bmdma_addr
31933173 * regardless of dma masks.
31943174 */
3195
- rc = dma_set_mask(&pdev->dev, ATA_DMA_MASK);
3175
+ rc = dma_set_mask_and_coherent(&pdev->dev, ATA_DMA_MASK);
31963176 if (rc)
31973177 ata_bmdma_nodma(host, "failed to set dma mask");
3198
- if (!rc) {
3199
- rc = dma_set_coherent_mask(&pdev->dev, ATA_DMA_MASK);
3200
- if (rc)
3201
- ata_bmdma_nodma(host,
3202
- "failed to set consistent dma mask");
3203
- }
32043178
32053179 /* request and iomap DMA region */
32063180 rc = pcim_iomap_regions(pdev, 1 << 4, dev_driver_string(gdev));