diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2019-02-05 17:33:19 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-02-06 17:19:14 +0000 |
commit | 2aaa8dd0938e8e978ce2fa1587cb6960cc32f15e (patch) | |
tree | be04f28cb6d30247f4793451660884fc4a6eb84b /drivers/spi/atmel-quadspi.c | |
parent | 9ce4c5128b96317beca4424c80e3595184e94fd1 (diff) |
spi: atmel-quadspi: return appropriate error code
Return -ENOTSUPP when atmel_qspi_find_mode() fails. Propagate
the error in atmel_qspi_exec_op().
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Boris Brezillon <bbrezillon@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/atmel-quadspi.c')
-rw-r--r-- | drivers/spi/atmel-quadspi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index be7f87fd5ac7..06c31830d07b 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -198,7 +198,7 @@ static int atmel_qspi_find_mode(const struct spi_mem_op *op) if (atmel_qspi_is_compatible(op, &sama5d2_qspi_modes[i])) return i; - return -1; + return -ENOTSUPP; } static bool atmel_qspi_supports_op(struct spi_mem *mem, @@ -238,7 +238,7 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) mode = atmel_qspi_find_mode(op); if (mode < 0) - return -ENOTSUPP; + return mode; ifr |= sama5d2_qspi_modes[mode].config; |