Skip to contentSkip to conversation

spi: cf_qspi: Fixup to_cf_qspi_slave macro

PATCH New Axel Lin 2 participants 2 messages Jan 15, 2015 – Feb 17, 2015 SPI

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 spi: cf_qspi: Fixup to_cf_qspi_slave macro

The third parameter of container_of is the name of the member within the struct. Current code only works if the parameter passed to to_cf_qspi_slave named slave. Fix it.

---
 drivers/spi/cf_qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/cf_qspi.c +1 -1
index 6b85633..834c5bd 100644
@@ -20,7 +20,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #define clamp(x, low, high) (min(max(low, x), high))
-#define to_cf_qspi_slave(s) container_of(s, struct cf_qspi_slave, s)
+#define to_cf_qspi_slave(s) container_of(s, struct cf_qspi_slave, slave)
 
 struct cf_qspi_slave {
 	struct spi_slave slave;	/* Specific bus:cs ID for each device */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 spi: cf_qspi: Fixup to_cf_qspi_slave macro

Quoted 23 lines · Axel Lin

The third parameter of container_of is the name of the member within the struct. Current code only works if the parameter passed to to_cf_qspi_slave named slave. Fix it.

---
 drivers/spi/cf_qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/cf_qspi.c +1 -2
index 6b85633..834c5bd 100644
@@ -20,7 +20,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #define clamp(x, low, high) (min(max(low, x), high))
-#define to_cf_qspi_slave(s) container_of(s, struct cf_qspi_slave, s)
+#define to_cf_qspi_slave(s) container_of(s, struct cf_qspi_slave, slave)
 
 struct cf_qspi_slave {
        struct spi_slave slave; /* Specific bus:cs ID for each device */
--
Quoted 4 lines

1.9.1

Applied to u-boot-spi/master

thanks!

Signature · 1 line
Jagan.