hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/rapidio/devices/tsi721.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * RapidIO mport driver for Tsi721 PCIExpress-to-SRIO bridge
34 *
45 * Copyright 2011 Integrated Device Technology, Inc.
56 * Alexandre Bounine <alexandre.bounine@idt.com>
67 * Chul Kim <chul.kim@idt.com>
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 Free
10
- * Software Foundation; either version 2 of the License, or (at your option)
11
- * any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful, but WITHOUT
14
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16
- * more details.
17
- *
18
- * You should have received a copy of the GNU General Public License along with
19
- * this program; if not, write to the Free Software Foundation, Inc., 59
20
- * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
218 */
229
2310 #include <linux/io.h>
....@@ -1382,9 +1369,9 @@
13821369 INIT_WORK(&priv->idb_work, tsi721_db_dpc);
13831370
13841371 /* Allocate buffer for inbound doorbells queue */
1385
- priv->idb_base = dma_zalloc_coherent(&priv->pdev->dev,
1386
- IDB_QSIZE * TSI721_IDB_ENTRY_SIZE,
1387
- &priv->idb_dma, GFP_KERNEL);
1372
+ priv->idb_base = dma_alloc_coherent(&priv->pdev->dev,
1373
+ IDB_QSIZE * TSI721_IDB_ENTRY_SIZE,
1374
+ &priv->idb_dma, GFP_KERNEL);
13881375 if (!priv->idb_base)
13891376 return -ENOMEM;
13901377
....@@ -1447,9 +1434,9 @@
14471434 regs = priv->regs + TSI721_DMAC_BASE(TSI721_DMACH_MAINT);
14481435
14491436 /* Allocate space for DMA descriptors */
1450
- bd_ptr = dma_zalloc_coherent(&priv->pdev->dev,
1451
- bd_num * sizeof(struct tsi721_dma_desc),
1452
- &bd_phys, GFP_KERNEL);
1437
+ bd_ptr = dma_alloc_coherent(&priv->pdev->dev,
1438
+ bd_num * sizeof(struct tsi721_dma_desc),
1439
+ &bd_phys, GFP_KERNEL);
14531440 if (!bd_ptr)
14541441 return -ENOMEM;
14551442
....@@ -1464,7 +1451,7 @@
14641451 sts_size = (bd_num >= TSI721_DMA_MINSTSSZ) ?
14651452 bd_num : TSI721_DMA_MINSTSSZ;
14661453 sts_size = roundup_pow_of_two(sts_size);
1467
- sts_ptr = dma_zalloc_coherent(&priv->pdev->dev,
1454
+ sts_ptr = dma_alloc_coherent(&priv->pdev->dev,
14681455 sts_size * sizeof(struct tsi721_dma_sts),
14691456 &sts_phys, GFP_KERNEL);
14701457 if (!sts_ptr) {
....@@ -1939,10 +1926,10 @@
19391926
19401927 /* Outbound message descriptor status FIFO allocation */
19411928 priv->omsg_ring[mbox].sts_size = roundup_pow_of_two(entries + 1);
1942
- priv->omsg_ring[mbox].sts_base = dma_zalloc_coherent(&priv->pdev->dev,
1943
- priv->omsg_ring[mbox].sts_size *
1944
- sizeof(struct tsi721_dma_sts),
1945
- &priv->omsg_ring[mbox].sts_phys, GFP_KERNEL);
1929
+ priv->omsg_ring[mbox].sts_base = dma_alloc_coherent(&priv->pdev->dev,
1930
+ priv->omsg_ring[mbox].sts_size * sizeof(struct tsi721_dma_sts),
1931
+ &priv->omsg_ring[mbox].sts_phys,
1932
+ GFP_KERNEL);
19461933 if (priv->omsg_ring[mbox].sts_base == NULL) {
19471934 tsi_debug(OMSG, &priv->pdev->dev,
19481935 "ENOMEM for OB_MSG_%d status FIFO", mbox);
....@@ -2768,7 +2755,7 @@
27682755 {
27692756 int i;
27702757
2771
- for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
2758
+ for (i = 0; i < PCI_STD_NUM_BARS; i++) {
27722759 tsi_debug(INIT, &pdev->dev, "res%d %pR",
27732760 i, &pdev->resource[i]);
27742761 }