Skip to contentSkip to conversation

hwmon: (lm70) Use SPI_MODE_X_MASK

PATCH Applied Andy Shevchenko 2 participants 2 messages May 10, 2021 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (lm70) Use SPI_MODE_X_MASK

Use SPI_MODE_X_MASK instead of open coded variant.

---
 drivers/hwmon/lm70.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/lm70.c +1 -1
index 40eab3349904..cdf23a59a203 100644
@@ -184,7 +184,7 @@ static int lm70_probe(struct spi_device *spi)
 
 
 	/* signaling is SPI_MODE_0 */
-	if (spi->mode & (SPI_CPOL | SPI_CPHA))
+	if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0)
 		return -EINVAL;
 
 	/* NOTE:  we assume 8-bit words, and convert to 16 bits manually */
Signature · 1 line
2.30.2
maintainer Applied
#1 lore raw
Quoted 3 lines · Andy Shevchenko

Use SPI_MODE_X_MASK instead of open coded variant.

Applied to hwmon-next.

Thanks,
Guenter

Quoted 17 lines
---
 drivers/hwmon/lm70.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/lm70.c +1 -1
index 40eab3349904..cdf23a59a203 100644
@@ -184,7 +184,7 @@ static int lm70_probe(struct spi_device *spi)
 
 
 	/* signaling is SPI_MODE_0 */
-	if (spi->mode & (SPI_CPOL | SPI_CPHA))
+	if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0)
 		return -EINVAL;
 
 	/* NOTE:  we assume 8-bit words, and convert to 16 bits manually */