Skip to content

Commit 4a074dd

Browse files
dlechbroonie
authored andcommitted
spi: axi-spi-engine: remove completed_id from driver state
In the AXI SPI Engine driver, the completed_id field in the driver state is only used in one function and the value does not need to persist between function calls. Therefore, it can be removed from the driver state and made a local variable in the function where it is used. Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://lore.kernel.org/r/20231117-axi-spi-engine-series-1-v1-11-cc59db999b87@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0c74de5 commit 4a074dd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/spi/spi-axi-spi-engine.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ struct spi_engine {
115115

116116
struct spi_message *msg;
117117
struct ida sync_ida;
118-
unsigned int completed_id;
119118

120119
unsigned int int_enable;
121120
};
@@ -380,13 +379,14 @@ static irqreturn_t spi_engine_irq(int irq, void *devid)
380379
struct spi_engine *spi_engine = spi_controller_get_devdata(host);
381380
unsigned int disable_int = 0;
382381
unsigned int pending;
382+
int completed_id = -1;
383383

384384
pending = readl_relaxed(spi_engine->base + SPI_ENGINE_REG_INT_PENDING);
385385

386386
if (pending & SPI_ENGINE_INT_SYNC) {
387387
writel_relaxed(SPI_ENGINE_INT_SYNC,
388388
spi_engine->base + SPI_ENGINE_REG_INT_PENDING);
389-
spi_engine->completed_id = readl_relaxed(
389+
completed_id = readl_relaxed(
390390
spi_engine->base + SPI_ENGINE_REG_SYNC_ID);
391391
}
392392

@@ -410,7 +410,7 @@ static irqreturn_t spi_engine_irq(int irq, void *devid)
410410
if (pending & SPI_ENGINE_INT_SYNC && spi_engine->msg) {
411411
struct spi_engine_message_state *st = spi_engine->msg->state;
412412

413-
if (spi_engine->completed_id == st->sync_id) {
413+
if (completed_id == st->sync_id) {
414414
struct spi_message *msg = spi_engine->msg;
415415

416416
msg->status = 0;

0 commit comments

Comments
 (0)