From: Axel Lin Date: Thu, 15 Jan 2015 05:32:55 +0000 (+0800) Subject: spi: cf_qspi: Fixup to_cf_qspi_slave macro X-Git-Tag: v2015.04-rc5~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a46988f11f7fad3043c6db1169f05d10f002d12c;p=u-boot 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. Signed-off-by: Axel Lin Reviewed-by: Jagannadha Sutradharudu Teki --- diff --git a/drivers/spi/cf_qspi.c b/drivers/spi/cf_qspi.c index 6b8563366b..834c5bd259 100644 --- a/drivers/spi/cf_qspi.c +++ b/drivers/spi/cf_qspi.c @@ -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 */