mirror of
https://github.com/vsergeev/c-periphery.git
synced 2026-02-06 23:42:24 +08:00
spi: fix calls to error helper when building without 32-bit mode support
Commit 56755acc78 introduced support for
32-bit extra flags. However, when compiling with a toolchain without
support for the extra flags, the following error appears:
src/spi.c:322:5: error: too few arguments to function '_spi_error'
return _spi_error(spi, SPI_ERROR_UNSUPPORTED, "Kernel version does not support 32-bit SPI mode flags");
This can be fixed by passing a third argument of 0.
Signed-off-by: Ryan Barnett <ryanbarnett3@gmail.com>
Signed-off-by: Vanya A. Sergeev <v@sergeev.io>
This commit is contained in:
committed by
Vanya A. Sergeev
parent
8c9f87227b
commit
708f7fe239
@@ -82,7 +82,7 @@ int spi_open_advanced2(spi_t *spi, const char *path, unsigned int mode, uint32_t
|
||||
return _spi_error(spi, SPI_ERROR_ARG, 0, "Invalid bit order (can be MSB_FIRST,LSB_FIRST)");
|
||||
#ifndef SPI_IOC_WR_MODE32
|
||||
if (extra_flags > 0xff)
|
||||
return _spi_error(spi, SPI_ERROR_UNSUPPORTED, "Kernel version does not support 32-bit SPI mode flags");
|
||||
return _spi_error(spi, SPI_ERROR_UNSUPPORTED, 0, "Kernel version does not support 32-bit SPI mode flags");
|
||||
#endif
|
||||
|
||||
memset(spi, 0, sizeof(spi_t));
|
||||
@@ -246,7 +246,7 @@ int spi_get_extra_flags32(spi_t *spi, uint32_t *extra_flags) {
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return _spi_error(spi, SPI_ERROR_UNSUPPORTED, "Kernel version does not support 32-bit SPI mode flags");
|
||||
return _spi_error(spi, SPI_ERROR_UNSUPPORTED, 0, "Kernel version does not support 32-bit SPI mode flags");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ int spi_set_extra_flags32(spi_t *spi, uint32_t extra_flags) {
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return _spi_error(spi, SPI_ERROR_UNSUPPORTED, "Kernel version does not support 32-bit SPI mode flags");
|
||||
return _spi_error(spi, SPI_ERROR_UNSUPPORTED, 0, "Kernel version does not support 32-bit SPI mode flags");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user