diff mbox series

[v1,1/1] hwmon: (lm70) Use SPI_MODE_X_MASK

Message ID 20210510141331.56736-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Headers show
Series [v1,1/1] hwmon: (lm70) Use SPI_MODE_X_MASK | expand

Commit Message

Andy Shevchenko May 10, 2021, 2:13 p.m. UTC
Use SPI_MODE_X_MASK instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/hwmon/lm70.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck May 10, 2021, 3:01 p.m. UTC | #1
On Mon, May 10, 2021 at 05:13:31PM +0300, Andy Shevchenko wrote:
> Use SPI_MODE_X_MASK instead of open coded variant.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/lm70.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
> index 40eab3349904..cdf23a59a203 100644
> --- a/drivers/hwmon/lm70.c
> +++ b/drivers/hwmon/lm70.c
> @@ -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 */
diff mbox series

Patch

diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index 40eab3349904..cdf23a59a203 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -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 */