Skip to contentSkip to conversation

mtd: spi-nor: Use SPI_MODE_X_MASK

PATCH Applied Andy Shevchenko 3 participants 3 messages May 10, 2021 – May 27, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spi-nor: Use SPI_MODE_X_MASK

Use SPI_MODE_X_MASK instead of open coded variant.

---
 drivers/mtd/spi-nor/controllers/nxp-spifi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/controllers/nxp-spifi.c +1 -1
index 5703e8313980..2635c80231bb 100644
@@ -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;
Signature · 6 lines
2.30.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Reviewed-by on v1 1/1
#1 lore raw

Am 2021-05-10 16:13, schrieb Andy Shevchenko:

Quoted 21 lines

Use SPI_MODE_X_MASK instead of open coded variant.

---
 drivers/mtd/spi-nor/controllers/nxp-spifi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/controllers/nxp-spifi.c +1 -1
index 5703e8313980..2635c80231bb 100644
@@ -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;
Quoted 1 line

break;

-michael