linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] hwmon: (lm70) Use SPI_MODE_X_MASK
@ 2021-05-10 14:13 Andy Shevchenko
  2021-05-10 15:01 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2021-05-10 14:13 UTC (permalink / raw)
  To: Andrej Picej, linux-hwmon, linux-kernel
  Cc: Jean Delvare, Guenter Roeck, Andy Shevchenko

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(-)

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 */
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] hwmon: (lm70) Use SPI_MODE_X_MASK
  2021-05-10 14:13 [PATCH v1 1/1] hwmon: (lm70) Use SPI_MODE_X_MASK Andy Shevchenko
@ 2021-05-10 15:01 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2021-05-10 15:01 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Andrej Picej, linux-hwmon, linux-kernel, Jean Delvare

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 */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-10 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 14:13 [PATCH v1 1/1] hwmon: (lm70) Use SPI_MODE_X_MASK Andy Shevchenko
2021-05-10 15:01 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).