Skip to content

Commit d9813cd

Browse files
looongbinbroonie
authored andcommitted
spi: sophgo: Fix incorrect use of bus width value macros
The previous code initialized the 'reg' value with specific bus-width values (BUS_WIDTH_2_BIT and BUS_WIDTH_4_BIT), which introduces ambiguity. Replace them with BUS_WIDTH_MASK to express the intention clearly. Fixes: de16c32 ("spi: sophgo: add SG2044 SPI NOR controller driver") Signed-off-by: Longbin Li <looong.bin@gmail.com> Link: https://patch.msgid.link/20251117090559.78288-1-looong.bin@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent bd79452 commit d9813cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/spi/spi-sg2044-nor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#define SPIFMC_TRAN_CSR_TRAN_MODE_RX BIT(0)
4343
#define SPIFMC_TRAN_CSR_TRAN_MODE_TX BIT(1)
4444
#define SPIFMC_TRAN_CSR_FAST_MODE BIT(3)
45+
#define SPIFMC_TRAN_CSR_BUS_WIDTH_MASK GENMASK(5, 4)
4546
#define SPIFMC_TRAN_CSR_BUS_WIDTH_1_BIT (0x00 << 4)
4647
#define SPIFMC_TRAN_CSR_BUS_WIDTH_2_BIT (0x01 << 4)
4748
#define SPIFMC_TRAN_CSR_BUS_WIDTH_4_BIT (0x02 << 4)
@@ -122,8 +123,7 @@ static u32 sg2044_spifmc_init_reg(struct sg2044_spifmc *spifmc)
122123
reg = readl(spifmc->io_base + SPIFMC_TRAN_CSR);
123124
reg &= ~(SPIFMC_TRAN_CSR_TRAN_MODE_MASK |
124125
SPIFMC_TRAN_CSR_FAST_MODE |
125-
SPIFMC_TRAN_CSR_BUS_WIDTH_2_BIT |
126-
SPIFMC_TRAN_CSR_BUS_WIDTH_4_BIT |
126+
SPIFMC_TRAN_CSR_BUS_WIDTH_MASK |
127127
SPIFMC_TRAN_CSR_DMA_EN |
128128
SPIFMC_TRAN_CSR_ADDR_BYTES_MASK |
129129
SPIFMC_TRAN_CSR_WITH_CMD |

0 commit comments

Comments
 (0)