Commit b01d5506 authored by Colin Ian King's avatar Colin Ian King Committed by Mark Brown

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: 0c79378c ("spi: add ancillary device support")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210623172300.161484-1-colin.king@canonical.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent d74d9922
...@@ -2183,7 +2183,7 @@ struct spi_device *spi_new_ancillary_device(struct spi_device *spi, ...@@ -2183,7 +2183,7 @@ struct spi_device *spi_new_ancillary_device(struct spi_device *spi,
/* Take over SPI mode/speed from SPI main device */ /* Take over SPI mode/speed from SPI main device */
ancillary->max_speed_hz = spi->max_speed_hz; ancillary->max_speed_hz = spi->max_speed_hz;
ancillary->mode = ancillary->mode; ancillary->mode = spi->mode;
/* Register the new device */ /* Register the new device */
rc = spi_add_device_locked(ancillary); rc = spi_add_device_locked(ancillary);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment