]> git.sur5r.net Git - u-boot/commitdiff
spi: cf_qspi: Fixup to_cf_qspi_slave macro
authorAxel Lin <axel.lin@ingics.com>
Thu, 15 Jan 2015 05:32:55 +0000 (13:32 +0800)
committerJagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Sun, 29 Mar 2015 20:09:20 +0000 (01:39 +0530)
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.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
drivers/spi/cf_qspi.c

index 6b8563366b8ee40d500066a6039b0bfad180ea78..834c5bd259d3fd2f2e4dcb7e0a27c86c52e3422f 100644 (file)
@@ -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 */