hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/spi/spi-xtensa-xtfpga.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Xtensa xtfpga SPI controller driver
34 *
45 * 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.
96 */
107
118 #include <linux/delay.h>
....@@ -83,7 +80,6 @@
8380 static int xtfpga_spi_probe(struct platform_device *pdev)
8481 {
8582 struct xtfpga_spi *xspi;
86
- struct resource *mem;
8783 int ret;
8884 struct spi_master *master;
8985
....@@ -100,14 +96,7 @@
10096 xspi->bitbang.master = master;
10197 xspi->bitbang.chipselect = xtfpga_spi_chipselect;
10298 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);
111100 if (IS_ERR(xspi->regs)) {
112101 ret = PTR_ERR(xspi->regs);
113102 goto err;