Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions drivers/spi/spi-dw-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,7 @@ static int dw_spi_transfer_one(struct spi_controller *host,
if (!dws->rx) {
dws->rx_len = 0;
cfg.tmode = DW_SPI_CTRLR0_TMOD_TO;
}

if (!dws->rx) {
dws->rx_len = 0;
cfg.tmode = DW_SPI_CTRLR0_TMOD_TO;
}
if (!dws->tx) {
} else if (!dws->tx) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the added else here changes behaviour. Was that intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as Phil stated, I think these are mutually exclusive events

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The switch to using an else is actually a change in behaviour - previously it was possible to enter the bodies of both if statements (if neither tx nor rx were set), but that's probably not possible (and certainly not useful) in reality. This way probably makes more sense.

dws->tx_len = 0;
cfg.tmode = DW_SPI_CTRLR0_TMOD_RO;
cfg.ndf = dws->rx_len;
Expand Down
Loading