.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /******************************************************************************* |
---|
2 | 3 | |
---|
3 | 4 | Copyright(c) 2006 Tundra Semiconductor Corporation. |
---|
4 | 5 | |
---|
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. |
---|
18 | 6 | |
---|
19 | 7 | *******************************************************************************/ |
---|
20 | 8 | |
---|
.. | .. |
---|
1312 | 1300 | data->id, dev->irq, dev->name); |
---|
1313 | 1301 | } |
---|
1314 | 1302 | |
---|
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); |
---|
1318 | 1307 | return -ENOMEM; |
---|
| 1308 | + } |
---|
1319 | 1309 | |
---|
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); |
---|
1322 | 1312 | if (!data->txring) { |
---|
| 1313 | + free_irq(data->irq_num, dev); |
---|
1323 | 1314 | dma_free_coherent(&data->pdev->dev, rxring_size, data->rxring, |
---|
1324 | 1315 | data->rxdma); |
---|
1325 | 1316 | return -ENOMEM; |
---|