[PATCH] fixup! spi: add litex spiflash driver

Ahmad Fatoum ahmad at a3f.at
Mon Aug 23 04:57:51 PDT 2021


bitio.h checks for a setbits macro and would define its own if none was
defined. This means setbits can't be used as symbol name later. Fix
this.

Signed-off-by: Ahmad Fatoum <ahmad at a3f.at>
---
 drivers/spi/litex_spiflash.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/litex_spiflash.c b/drivers/spi/litex_spiflash.c
index 26ef207699eb..6701e9866a13 100644
--- a/drivers/spi/litex_spiflash.c
+++ b/drivers/spi/litex_spiflash.c
@@ -35,7 +35,7 @@ static inline void litex_spiflash_spi_wr(struct litex_spiflash_spi *sp, u32 val,
 	writel(val, sp->regs + reg);
 }
 
-static inline void setbits(struct litex_spiflash_spi *sp, int bits, int on)
+static inline void litex_spiflash_setbits(struct litex_spiflash_spi *sp, int bits, int on)
 {
 	/*
 	 * We are the only user of SCSPTR so no locking is required.
@@ -62,7 +62,7 @@ static inline void setsck(struct spi_device *spi, int on)
 {
 	struct litex_spiflash_spi *sc = litex_spiflash_spidev_to_sp(spi);
 
-	setbits(sc, SPIFLASH_BB_CLK, on);
+	litex_spiflash_setbits(sc, SPIFLASH_BB_CLK, on);
 }
 
 static inline void setmosi(struct spi_device *spi, int on)
@@ -70,14 +70,14 @@ static inline void setmosi(struct spi_device *spi, int on)
 	struct litex_spiflash_spi *sc = litex_spiflash_spidev_to_sp(spi);
 
 	sc->val &= ~SPIFLASH_BB_DIR;
-	setbits(sc, SPIFLASH_BB_MOSI, on);
+	litex_spiflash_setbits(sc, SPIFLASH_BB_MOSI, on);
 }
 
 static inline u32 getmiso(struct spi_device *spi)
 {
 	struct litex_spiflash_spi *sc = litex_spiflash_spidev_to_sp(spi);
 
-	setbits(sc, SPIFLASH_BB_DIR, 1);
+	litex_spiflash_setbits(sc, SPIFLASH_BB_DIR, 1);
 	return !!((litex_spiflash_spi_rr(sc, SPIFLASH_MISO) & 1));
 }
 
@@ -87,7 +87,7 @@ static inline u32 getmiso(struct spi_device *spi)
 
 static inline void litex_spiflash_spi_chipselect(struct litex_spiflash_spi *sc, int on)
 {
-	setbits(sc, SPIFLASH_BB_CSN, on);
+	litex_spiflash_setbits(sc, SPIFLASH_BB_CSN, on);
 }
 
 static int litex_spiflash_spi_setup(struct spi_device *spi)
-- 
2.33.0




More information about the barebox mailing list