.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * RapidIO mport driver for Tsi721 PCIExpress-to-SRIO bridge |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2011 Integrated Device Technology, Inc. |
---|
5 | 6 | * Alexandre Bounine <alexandre.bounine@idt.com> |
---|
6 | 7 | * 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. |
---|
21 | 8 | */ |
---|
22 | 9 | |
---|
23 | 10 | #include <linux/io.h> |
---|
.. | .. |
---|
1382 | 1369 | INIT_WORK(&priv->idb_work, tsi721_db_dpc); |
---|
1383 | 1370 | |
---|
1384 | 1371 | /* 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); |
---|
1388 | 1375 | if (!priv->idb_base) |
---|
1389 | 1376 | return -ENOMEM; |
---|
1390 | 1377 | |
---|
.. | .. |
---|
1447 | 1434 | regs = priv->regs + TSI721_DMAC_BASE(TSI721_DMACH_MAINT); |
---|
1448 | 1435 | |
---|
1449 | 1436 | /* 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); |
---|
1453 | 1440 | if (!bd_ptr) |
---|
1454 | 1441 | return -ENOMEM; |
---|
1455 | 1442 | |
---|
.. | .. |
---|
1464 | 1451 | sts_size = (bd_num >= TSI721_DMA_MINSTSSZ) ? |
---|
1465 | 1452 | bd_num : TSI721_DMA_MINSTSSZ; |
---|
1466 | 1453 | 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, |
---|
1468 | 1455 | sts_size * sizeof(struct tsi721_dma_sts), |
---|
1469 | 1456 | &sts_phys, GFP_KERNEL); |
---|
1470 | 1457 | if (!sts_ptr) { |
---|
.. | .. |
---|
1939 | 1926 | |
---|
1940 | 1927 | /* Outbound message descriptor status FIFO allocation */ |
---|
1941 | 1928 | 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); |
---|
1946 | 1933 | if (priv->omsg_ring[mbox].sts_base == NULL) { |
---|
1947 | 1934 | tsi_debug(OMSG, &priv->pdev->dev, |
---|
1948 | 1935 | "ENOMEM for OB_MSG_%d status FIFO", mbox); |
---|
.. | .. |
---|
2768 | 2755 | { |
---|
2769 | 2756 | int i; |
---|
2770 | 2757 | |
---|
2771 | | - for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { |
---|
| 2758 | + for (i = 0; i < PCI_STD_NUM_BARS; i++) { |
---|
2772 | 2759 | tsi_debug(INIT, &pdev->dev, "res%d %pR", |
---|
2773 | 2760 | i, &pdev->resource[i]); |
---|
2774 | 2761 | } |
---|