Skip to content

Commit b01d550

Browse files
Colin Ian Kingbroonie
authored andcommitted
spi: Fix self assignment issue with ancillary->mode
There is an assignment of ancillary->mode to itself which looks dubious since the proceeding comment states that the speed and mode is taken over from the SPI main device, indicating that ancillary->mode should assigned using the value spi->mode. Fix this. Addresses-Coverity: ("Self assignment") Fixes: 0c79378 ("spi: add ancillary device support") Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d74d992 commit b01d550

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ struct spi_device *spi_new_ancillary_device(struct spi_device *spi,
21832183

21842184
/* Take over SPI mode/speed from SPI main device */
21852185
ancillary->max_speed_hz = spi->max_speed_hz;
2186-
ancillary->mode = ancillary->mode;
2186+
ancillary->mode = spi->mode;
21872187

21882188
/* Register the new device */
21892189
rc = spi_add_device_locked(ancillary);

0 commit comments

Comments
 (0)