forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/apm/xgene-v2/main.c
....@@ -1,22 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Applied Micro X-Gene SoC Ethernet v2 Driver
34 *
45 * Copyright (c) 2017, Applied Micro Circuits Corporation
56 * Author(s): Iyappan Subramanian <isubramanian@apm.com>
67 * Keyur Chudgar <kchudgar@apm.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
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
208 */
219
2210 #include "main.h"
....@@ -66,10 +54,8 @@
6654 }
6755
6856 ret = platform_get_irq(pdev, 0);
69
- if (ret < 0) {
70
- dev_err(dev, "Unable to get irq\n");
57
+ if (ret < 0)
7158 return ret;
72
- }
7359 pdata->resources.irq = ret;
7460
7561 return 0;
....@@ -206,8 +192,8 @@
206192 }
207193
208194 /* Packet buffers should be 64B aligned */
209
- pkt_buf = dma_zalloc_coherent(dev, XGENE_ENET_STD_MTU, &dma_addr,
210
- GFP_ATOMIC);
195
+ pkt_buf = dma_alloc_coherent(dev, XGENE_ENET_STD_MTU, &dma_addr,
196
+ GFP_ATOMIC);
211197 if (unlikely(!pkt_buf)) {
212198 dev_kfree_skb_any(skb);
213199 return NETDEV_TX_OK;
....@@ -428,8 +414,8 @@
428414 ring->ndev = ndev;
429415
430416 size = XGENE_ENET_DESC_SIZE * XGENE_ENET_NUM_DESC;
431
- ring->desc_addr = dma_zalloc_coherent(dev, size, &ring->dma_addr,
432
- GFP_KERNEL);
417
+ ring->desc_addr = dma_alloc_coherent(dev, size, &ring->dma_addr,
418
+ GFP_KERNEL);
433419 if (!ring->desc_addr)
434420 goto err;
435421
....@@ -589,7 +575,7 @@
589575 }
590576 }
591577
592
-static void xge_timeout(struct net_device *ndev)
578
+static void xge_timeout(struct net_device *ndev, unsigned int txqueue)
593579 {
594580 struct xge_pdata *pdata = netdev_priv(ndev);
595581
....@@ -757,5 +743,4 @@
757743
758744 MODULE_DESCRIPTION("APM X-Gene SoC Ethernet v2 driver");
759745 MODULE_AUTHOR("Iyappan Subramanian <isubramanian@apm.com>");
760
-MODULE_VERSION(XGENE_ENET_V2_VERSION);
761746 MODULE_LICENSE("GPL");