hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/ata/sata_sil24.c
....@@ -1,20 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * sata_sil24.c - Driver for Silicon Image 3124/3132 SATA-2 controllers
34 *
45 * Copyright 2005 Tejun Heo
56 *
67 * Based on preview driver from Silicon Image.
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2, or (at your option) any
11
- * later version.
12
- *
13
- * This program is distributed in the hope that it will be useful, but
14
- * WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * General Public License for more details.
17
- *
188 */
199
2010 #include <linux/kernel.h>
....@@ -1214,7 +1204,6 @@
12141204 cb = dmam_alloc_coherent(dev, cb_size, &cb_dma, GFP_KERNEL);
12151205 if (!cb)
12161206 return -ENOMEM;
1217
- memset(cb, 0, cb_size);
12181207
12191208 pp->cmd_block = cb;
12201209 pp->cmd_block_dma = cb_dma;
....@@ -1314,28 +1303,10 @@
13141303 host->iomap = iomap;
13151304
13161305 /* configure and activate the device */
1317
- if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
1318
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
1319
- if (rc) {
1320
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
1321
- if (rc) {
1322
- dev_err(&pdev->dev,
1323
- "64-bit DMA enable failed\n");
1324
- return rc;
1325
- }
1326
- }
1327
- } else {
1328
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
1329
- if (rc) {
1330
- dev_err(&pdev->dev, "32-bit DMA enable failed\n");
1331
- return rc;
1332
- }
1333
- rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
1334
- if (rc) {
1335
- dev_err(&pdev->dev,
1336
- "32-bit consistent DMA enable failed\n");
1337
- return rc;
1338
- }
1306
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
1307
+ if (rc) {
1308
+ dev_err(&pdev->dev, "DMA enable failed\n");
1309
+ return rc;
13391310 }
13401311
13411312 /* Set max read request size to 4096. This slightly increases