| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * This program is free software; you can redistribute it and/or |
|---|
| 3 | | - * modify it under the terms of the GNU General Public License |
|---|
| 4 | | - * as published by the Free Software Foundation; either version 2 |
|---|
| 5 | | - * of the License, or (at your option) any later version. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 8 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 9 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 10 | | - * GNU General Public License for more details. |
|---|
| 11 | | - * |
|---|
| 12 | | - * You should have received a copy of the GNU General Public License |
|---|
| 13 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
|---|
| 14 | 3 | */ |
|---|
| 15 | 4 | |
|---|
| 16 | 5 | /** |
|---|
| .. | .. |
|---|
| 181 | 170 | return 0; |
|---|
| 182 | 171 | } |
|---|
| 183 | 172 | |
|---|
| 184 | | -dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr) |
|---|
| 173 | +dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |
|---|
| 185 | 174 | { |
|---|
| 186 | 175 | return paddr + ar2315_dev_offset(dev); |
|---|
| 187 | 176 | } |
|---|
| 188 | 177 | |
|---|
| 189 | | -phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr) |
|---|
| 178 | +phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dma_addr) |
|---|
| 190 | 179 | { |
|---|
| 191 | 180 | return dma_addr - ar2315_dev_offset(dev); |
|---|
| 192 | 181 | } |
|---|
| .. | .. |
|---|
| 434 | 423 | return -EINVAL; |
|---|
| 435 | 424 | apc->irq = irq; |
|---|
| 436 | 425 | |
|---|
| 437 | | - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, |
|---|
| 438 | | - "ar2315-pci-ctrl"); |
|---|
| 439 | | - apc->mmr_mem = devm_ioremap_resource(dev, res); |
|---|
| 426 | + apc->mmr_mem = devm_platform_ioremap_resource_byname(pdev, |
|---|
| 427 | + "ar2315-pci-ctrl"); |
|---|
| 440 | 428 | if (IS_ERR(apc->mmr_mem)) |
|---|
| 441 | 429 | return PTR_ERR(apc->mmr_mem); |
|---|
| 442 | 430 | |
|---|
| .. | .. |
|---|
| 452 | 440 | apc->mem_res.flags = IORESOURCE_MEM; |
|---|
| 453 | 441 | |
|---|
| 454 | 442 | /* Remap PCI config space */ |
|---|
| 455 | | - apc->cfg_mem = devm_ioremap_nocache(dev, res->start, |
|---|
| 443 | + apc->cfg_mem = devm_ioremap(dev, res->start, |
|---|
| 456 | 444 | AR2315_PCI_CFG_SIZE); |
|---|
| 457 | 445 | if (!apc->cfg_mem) { |
|---|
| 458 | 446 | dev_err(dev, "failed to remap PCI config space\n"); |
|---|