.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Xtensa xtfpga SPI controller driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2014 Cadence Design Systems Inc. |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License version 2 as |
---|
8 | | - * published by the Free Software Foundation. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #include <linux/delay.h> |
---|
.. | .. |
---|
83 | 80 | static int xtfpga_spi_probe(struct platform_device *pdev) |
---|
84 | 81 | { |
---|
85 | 82 | struct xtfpga_spi *xspi; |
---|
86 | | - struct resource *mem; |
---|
87 | 83 | int ret; |
---|
88 | 84 | struct spi_master *master; |
---|
89 | 85 | |
---|
.. | .. |
---|
100 | 96 | xspi->bitbang.master = master; |
---|
101 | 97 | xspi->bitbang.chipselect = xtfpga_spi_chipselect; |
---|
102 | 98 | xspi->bitbang.txrx_word[SPI_MODE_0] = xtfpga_spi_txrx_word; |
---|
103 | | - |
---|
104 | | - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
105 | | - if (!mem) { |
---|
106 | | - dev_err(&pdev->dev, "No memory resource\n"); |
---|
107 | | - ret = -ENODEV; |
---|
108 | | - goto err; |
---|
109 | | - } |
---|
110 | | - xspi->regs = devm_ioremap_resource(&pdev->dev, mem); |
---|
| 99 | + xspi->regs = devm_platform_ioremap_resource(pdev, 0); |
---|
111 | 100 | if (IS_ERR(xspi->regs)) { |
---|
112 | 101 | ret = PTR_ERR(xspi->regs); |
---|
113 | 102 | goto err; |
---|