Skip to contentSkip to conversation

spi: atcspi200: Change include order

PATCH New Jagan Teki 2 participants 9 messages May 8, 2019

Subsystems (3)
lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/3 spi: atcspi200: Change include order

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the atcspi200_spi driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/nds32/include/asm/u-boot.h:24,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/spi/atcspi200_spi.c:9:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files in atcspi200_spi.c to include first common.h file.

---
 drivers/spi/atcspi200_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/atcspi200_spi.c +1 -1
index af96c6d21e..e0cc323444 100644
@@ -6,8 +6,8 @@
  * Author: Rick Chen (rick at andestech.com)
  */
 
-#include <clk.h>
 #include <common.h>
+#include <clk.h>
 #include <malloc.h>
 #include <spi.h>
 #include <asm/io.h>
Signature · 1 line
2.18.0.321.gffc6fa0e3
author
#1 lore raw

PATCH 1/3 spi: atcspi200: Change include order

Quoted 19 lines · Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the atcspi200_spi driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/nds32/include/asm/u-boot.h:24,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/spi/atcspi200_spi.c:9:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

Quoted 5 lines

So, fix consists of changing the order of include files in atcspi200_spi.c to include first common.h file.

---

Applied to u-boot-sunxi/master

author
#2 lore raw

PATCH 2/3 clk: sifive: fu540-prci: Change include order

In reply to Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the fu540-prci driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from include/clk-uclass.h:13,
                 from drivers/clk/sifive/fu540-prci.c:32:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files in fu540-prci.c to include first common.h file.

Cc Anup Patel <[email protected]>
Cc Rick Chen <[email protected]>
Cc Paul Walmsley <[email protected]>
---
 drivers/clk/sifive/fu540-prci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sifive/fu540-prci.c +1 -1
index e1b5f8e6a9..2d47ebc6b1 100644
@@ -28,10 +28,10 @@
  * - SiFive FU540-C000 manual v1p0, Chapter 7 "Clocking and Reset"
  */
 
+#include <common.h>
 #include <asm/io.h>
 #include <clk-uclass.h>
 #include <clk.h>
-#include <common.h>
 #include <div64.h>
 #include <dm.h>
 #include <errno.h>
Signature · 1 line
2.18.0.321.gffc6fa0e3
#3 lore raw

PATCH 2/3 clk: sifive: fu540-prci: Change include order

Quoted 23 lines · Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the fu540-prci driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from include/clk-uclass.h:13,
                 from drivers/clk/sifive/fu540-prci.c:32:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files in fu540-prci.c to include first common.h file.

Quoted 8 lines
Cc Anup Patel <[email protected]>
Cc Rick Chen <[email protected]>
Cc Paul Walmsley <[email protected]>
---
 drivers/clk/sifive/fu540-prci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
author
#4 lore raw

PATCH 2/3 clk: sifive: fu540-prci: Change include order

In reply to Jagan Teki
Quoted 20 lines · Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the fu540-prci driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from include/clk-uclass.h:13,
                 from drivers/clk/sifive/fu540-prci.c:32:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

Quoted 8 lines

So, fix consists of changing the order of include files in fu540-prci.c to include first common.h file.

Cc Anup Patel <[email protected]>
Cc Rick Chen <[email protected]>
Cc Paul Walmsley <[email protected]>

---

Applied to u-boot-sunxi/master

#5 lore raw

PATCH 1/3 spi: atcspi200: Change include order

In reply to Jagan Teki
Quoted 19 lines · Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the atcspi200_spi driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/nds32/include/asm/u-boot.h:24,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/spi/atcspi200_spi.c:9:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

Quoted 8 lines

So, fix consists of changing the order of include files in atcspi200_spi.c to include first common.h file.

---
 drivers/spi/atcspi200_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
author
#6 lore raw

PATCH 3/3 serial: sifive: Change include order

In reply to Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the serial_sifive driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/serial/serial_sifive.c:6:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files in serial_sifive.c to include first common.h file.

Cc Anup Patel <[email protected]>
Cc Rick Chen <[email protected]>
Cc Paul Walmsley <[email protected]>
---
 drivers/serial/serial_sifive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/serial/serial_sifive.c +1 -1
index 537bc7a975..fdfef69aaa 100644
@@ -3,8 +3,8 @@
  * Copyright (C) 2018 Anup Patel <[email protected]>
  */
 
-#include <clk.h>
 #include <common.h>
+#include <clk.h>
 #include <debug_uart.h>
 #include <dm.h>
 #include <errno.h>
Signature · 1 line
2.18.0.321.gffc6fa0e3
#7 lore raw

PATCH 3/3 serial: sifive: Change include order

Quoted 22 lines · Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the serial_sifive driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/serial/serial_sifive.c:6:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

So, fix consists of changing the order of include files in serial_sifive.c to include first common.h file.

Quoted 8 lines
Cc Anup Patel <[email protected]>
Cc Rick Chen <[email protected]>
Cc Paul Walmsley <[email protected]>
---
 drivers/serial/serial_sifive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
author
#8 lore raw

PATCH 3/3 serial: sifive: Change include order

In reply to Jagan Teki
Quoted 19 lines · Jagan Teki

Like clk_get_by_index, there is requirement for clk_get_by_index_nodev. In this case to make common code functionalities for dev and nodev, clk_get_by_index is trying to get the index of clock by passing ofnode instead of actual dev like current gpio uclass does.

In these scenarios with current order of include files the serial_sifive driver is unable to find CONFIG_ENV_SIZE.

In file included from arch/riscv/include/asm/u-boot.h:23:0,

                 from include/dm/of.h:10,
                 from include/dm/ofnode.h:12,
                 from include/clk.h:11,
                 from drivers/serial/serial_sifive.c:6:

include/environment.h:145:19: error: 'CONFIG_ENV_SIZE' undeclared here (not in a function); did you mean 'CONFIG_CMD_XIMG'?
#define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)

Quoted 8 lines

So, fix consists of changing the order of include files in serial_sifive.c to include first common.h file.

Cc Anup Patel <[email protected]>
Cc Rick Chen <[email protected]>
Cc Paul Walmsley <[email protected]>

---

Applied to u-boot-sunxi/master