Skip to contentSkip to conversation

spi: designware: Change include order

PATCH New Horatiu.Vultur at microchip.com 2 participants 2 messages Feb 25, 2019 – Mar 4, 2019 1 message not in the archive SPI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 spi: designware: Change include order

With current order of include files, the file designware_spi.c can't see that the struct global_data has the member board_type when CONFIG_BOARD_TYPES is defined. By not seeing this then all the members are shifted in the struct global_data. So when the driver is trying to read from device tree blob, it would pass the wrong address to the function 'fdtdev_get_int'. This will make to use the default frequency 500000.

The fix consists of changing the order of include files in designware_spi.c to include first common.h file.

---
 drivers/spi/designware_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/designware_spi.c +1 -1
index 02d9376..dadb6fa 100644
@@ -9,8 +9,8 @@
  * Copyright (c) 2009, Intel Corporation.
  */
 
-#include <asm-generic/gpio.h>
 #include <common.h>
+#include <asm-generic/gpio.h>
 #include <clk.h>
 #include <dm.h>
 #include <errno.h>

--
2.7.4

#2 lore raw

PATCH 1/1 spi: designware: Change include order

Quoted 9 lines · On Mon, Feb 25, 2019 at 4:29 PM <[email protected]> wrote:

With current order of include files, the file designware_spi.c can't see that the struct global_data has the member board_type when CONFIG_BOARD_TYPES is defined. By not seeing this then all the members are shifted in the struct global_data. So when the driver is trying to read from device tree blob, it would pass the wrong address to the function 'fdtdev_get_int'. This will make to use the default frequency 500000.

Quoted 5 lines

The fix consists of changing the order of include files in designware_spi.c to include first common.h file.

---

Applied to u-boot-spi/master