spi: Introduce SPI_INVALID_CS and is_valid_cs()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 7 Mar 2024 15:01:01 +0000 (17:01 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 7 Mar 2024 15:07:11 +0000 (15:07 +0000)
commitbe84be4a35fa99cca7e81e6dd21516a324cca413
treefb9b97ca44bd4f7e51b5317bc0ecb3024f769186
parent14fe5a98fb24192f73639590d9d3cdb5640d48db
spi: Introduce SPI_INVALID_CS and is_valid_cs()

The SPI core inconsistently uses the marker value for unused chip select
pin. Define a constant (with appropriate type) and introduce is_valid_cs()
helper function to avoid spreading this inconsistency in the future.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240307150256.3789138-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c