diff mbox series

[v1,1/1] mtd: spi-nor: Use SPI_MODE_X_MASK

Message ID 20210510141343.56805-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v1,1/1] mtd: spi-nor: 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/mtd/spi-nor/controllers/nxp-spifi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Walle May 10, 2021, 8:23 p.m. UTC | #1
Am 2021-05-10 16:13, schrieb Andy Shevchenko:
> Use SPI_MODE_X_MASK instead of open coded variant.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mtd/spi-nor/controllers/nxp-spifi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/controllers/nxp-spifi.c
> b/drivers/mtd/spi-nor/controllers/nxp-spifi.c
> index 5703e8313980..2635c80231bb 100644
> --- a/drivers/mtd/spi-nor/controllers/nxp-spifi.c
> +++ b/drivers/mtd/spi-nor/controllers/nxp-spifi.c
> @@ -326,7 +326,7 @@ static int nxp_spifi_setup_flash(struct nxp_spifi 
> *spifi,
>  		ctrl |= SPIFI_CTRL_DUAL;
>  	}
> 
> -	switch (mode & (SPI_CPHA | SPI_CPOL)) {
> +	switch (mode & SPI_MODE_X_MASK) {
>  	case SPI_MODE_0:
>  		ctrl &= ~SPIFI_CTRL_MODE3;
>  		break;

Reviewed-by: Michael Walle <michael@walle.cc>

-michael
Vignesh Raghavendra May 27, 2021, 2:06 p.m. UTC | #2
On Mon, 10 May 2021 17:13:43 +0300, Andy Shevchenko wrote:
> Use SPI_MODE_X_MASK instead of open coded variant.

Updated $subject to:
 "mtd: spi-nor: nxp-spifi: Use SPI_MODE_X_MASK"

Applied to spi-nor/next, thanks!
[1/1] mtd: spi-nor: Use SPI_MODE_X_MASK
      https://git.kernel.org/mtd/c/5c26d52c9e

--
Regards
Vignesh
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/controllers/nxp-spifi.c b/drivers/mtd/spi-nor/controllers/nxp-spifi.c
index 5703e8313980..2635c80231bb 100644
--- a/drivers/mtd/spi-nor/controllers/nxp-spifi.c
+++ b/drivers/mtd/spi-nor/controllers/nxp-spifi.c
@@ -326,7 +326,7 @@  static int nxp_spifi_setup_flash(struct nxp_spifi *spifi,
 		ctrl |= SPIFI_CTRL_DUAL;
 	}
 
-	switch (mode & (SPI_CPHA | SPI_CPOL)) {
+	switch (mode & SPI_MODE_X_MASK) {
 	case SPI_MODE_0:
 		ctrl &= ~SPIFI_CTRL_MODE3;
 		break;