forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/tundra/tsi108_eth.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*******************************************************************************
23
34 Copyright(c) 2006 Tundra Semiconductor Corporation.
45
5
- This program is free software; you can redistribute it and/or modify it
6
- under the terms of the GNU General Public License as published by the Free
7
- Software Foundation; either version 2 of the License, or (at your option)
8
- any later version.
9
-
10
- This program is distributed in the hope that it will be useful, but WITHOUT
11
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
- more details.
14
-
15
- You should have received a copy of the GNU General Public License along with
16
- this program; if not, write to the Free Software Foundation, Inc., 59
17
- Temple Place - Suite 330, Boston, MA 02111-1307, USA.
186
197 *******************************************************************************/
208
....@@ -1312,14 +1300,17 @@
13121300 data->id, dev->irq, dev->name);
13131301 }
13141302
1315
- data->rxring = dma_zalloc_coherent(&data->pdev->dev, rxring_size,
1316
- &data->rxdma, GFP_KERNEL);
1317
- if (!data->rxring)
1303
+ data->rxring = dma_alloc_coherent(&data->pdev->dev, rxring_size,
1304
+ &data->rxdma, GFP_KERNEL);
1305
+ if (!data->rxring) {
1306
+ free_irq(data->irq_num, dev);
13181307 return -ENOMEM;
1308
+ }
13191309
1320
- data->txring = dma_zalloc_coherent(&data->pdev->dev, txring_size,
1321
- &data->txdma, GFP_KERNEL);
1310
+ data->txring = dma_alloc_coherent(&data->pdev->dev, txring_size,
1311
+ &data->txdma, GFP_KERNEL);
13221312 if (!data->txring) {
1313
+ free_irq(data->irq_num, dev);
13231314 dma_free_coherent(&data->pdev->dev, rxring_size, data->rxring,
13241315 data->rxdma);
13251316 return -ENOMEM;