hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/misc/lattice-ecp3-config.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2012 Stefan Roese <sr@denx.de>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
84 */
95
106 #include <linux/device.h>
....@@ -71,7 +67,6 @@
7167 struct spi_device *spi = (struct spi_device *)context;
7268 struct fpga_data *data = spi_get_drvdata(spi);
7369 u8 *buffer;
74
- int ret;
7570 u8 txbuf[8];
7671 u8 rxbuf[8];
7772 int rx_len = 8;
....@@ -96,7 +91,7 @@
9691
9792 /* Trying to speak with the FPGA via SPI... */
9893 txbuf[0] = FPGA_CMD_READ_ID;
99
- ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
94
+ spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
10095 jedec_id = get_unaligned_be32(&rxbuf[4]);
10196 dev_dbg(&spi->dev, "FPGA JTAG ID=%08x\n", jedec_id);
10297
....@@ -114,7 +109,7 @@
114109 dev_info(&spi->dev, "FPGA %s detected\n", ecp3_dev[i].name);
115110
116111 txbuf[0] = FPGA_CMD_READ_STATUS;
117
- ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
112
+ spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
118113 status = get_unaligned_be32(&rxbuf[4]);
119114 dev_dbg(&spi->dev, "FPGA Status=%08x\n", status);
120115
....@@ -134,20 +129,20 @@
134129 memcpy(buffer + 4, fw->data, fw->size);
135130
136131 txbuf[0] = FPGA_CMD_REFRESH;
137
- ret = spi_write(spi, txbuf, 4);
132
+ spi_write(spi, txbuf, 4);
138133
139134 txbuf[0] = FPGA_CMD_WRITE_EN;
140
- ret = spi_write(spi, txbuf, 4);
135
+ spi_write(spi, txbuf, 4);
141136
142137 txbuf[0] = FPGA_CMD_CLEAR;
143
- ret = spi_write(spi, txbuf, 4);
138
+ spi_write(spi, txbuf, 4);
144139
145140 /*
146141 * Wait for FPGA memory to become cleared
147142 */
148143 for (i = 0; i < FPGA_CLEAR_LOOP_COUNT; i++) {
149144 txbuf[0] = FPGA_CMD_READ_STATUS;
150
- ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
145
+ spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
151146 status = get_unaligned_be32(&rxbuf[4]);
152147 if (status == FPGA_STATUS_CLEARED)
153148 break;
....@@ -164,13 +159,13 @@
164159 }
165160
166161 dev_info(&spi->dev, "Configuring the FPGA...\n");
167
- ret = spi_write(spi, buffer, fw->size + 8);
162
+ spi_write(spi, buffer, fw->size + 8);
168163
169164 txbuf[0] = FPGA_CMD_WRITE_DIS;
170
- ret = spi_write(spi, txbuf, 4);
165
+ spi_write(spi, txbuf, 4);
171166
172167 txbuf[0] = FPGA_CMD_READ_STATUS;
173
- ret = spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
168
+ spi_write_then_read(spi, txbuf, 8, rxbuf, rx_len);
174169 status = get_unaligned_be32(&rxbuf[4]);
175170 dev_dbg(&spi->dev, "FPGA Status=%08x\n", status);
176171