diff mbox series

firmware: tegra: bpmp: fix T234 build failure

Message ID 20201203230625.1480626-1-arnd@kernel.org
State Rejected
Headers show
Series firmware: tegra: bpmp: fix T234 build failure | expand

Commit Message

Arnd Bergmann Dec. 3, 2020, 11:06 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

When only Tegra 234 is enabled, the bpmp driver fails
to build:

drivers/firmware/tegra/bpmp.c:861:51: error: 'tegra186_soc' undeclared here (not in a function)
  861 |  { .compatible = "nvidia,tegra186-bpmp", .data = &tegra186_soc },
      |                                                   ^~~~~~~~~~~~

Fix the #ifdef statement to match the location in which this
symbol is used.

Fixes: 0ebdf11699d0 ("firmware: tegra: Enable BPMP support on Tegra234")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/firmware/tegra/Makefile       | 1 +
 drivers/firmware/tegra/bpmp-private.h | 3 ++-
 drivers/firmware/tegra/bpmp.c         | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

Comments

Thierry Reding Dec. 4, 2020, 11:11 a.m. UTC | #1
On Fri, Dec 04, 2020 at 12:06:20AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When only Tegra 234 is enabled, the bpmp driver fails
> to build:
> 
> drivers/firmware/tegra/bpmp.c:861:51: error: 'tegra186_soc' undeclared here (not in a function)
>   861 |  { .compatible = "nvidia,tegra186-bpmp", .data = &tegra186_soc },
>       |                                                   ^~~~~~~~~~~~
> 
> Fix the #ifdef statement to match the location in which this
> symbol is used.
> 
> Fixes: 0ebdf11699d0 ("firmware: tegra: Enable BPMP support on Tegra234")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/firmware/tegra/Makefile       | 1 +
>  drivers/firmware/tegra/bpmp-private.h | 3 ++-
>  drivers/firmware/tegra/bpmp.c         | 3 ++-
>  3 files changed, 5 insertions(+), 2 deletions(-)

Sigh... I wonder if I should just give up and eliminate all
ARCH_TEGRA_XYZ_SOC options. There's not a lot that we gain by keeping
them around and most people will be building multi-platform
configurations anyway, so there's very little point to it.

Anyway, this looks good, so:

Acked-by: Thierry Reding <treding@nvidia.com>

Let me know if you'd prefer me to pick this up and send as a follow-up
pull request for Tegra.

Thierry
diff mbox series

Patch

diff --git a/drivers/firmware/tegra/Makefile b/drivers/firmware/tegra/Makefile
index 49c87e00fafb..620cf3fdd607 100644
--- a/drivers/firmware/tegra/Makefile
+++ b/drivers/firmware/tegra/Makefile
@@ -3,6 +3,7 @@  tegra-bpmp-y			= bpmp.o
 tegra-bpmp-$(CONFIG_ARCH_TEGRA_210_SOC)	+= bpmp-tegra210.o
 tegra-bpmp-$(CONFIG_ARCH_TEGRA_186_SOC)	+= bpmp-tegra186.o
 tegra-bpmp-$(CONFIG_ARCH_TEGRA_194_SOC)	+= bpmp-tegra186.o
+tegra-bpmp-$(CONFIG_ARCH_TEGRA_234_SOC)	+= bpmp-tegra186.o
 tegra-bpmp-$(CONFIG_DEBUG_FS)	+= bpmp-debugfs.o
 obj-$(CONFIG_TEGRA_BPMP)	+= tegra-bpmp.o
 obj-$(CONFIG_TEGRA_IVC)		+= ivc.o
diff --git a/drivers/firmware/tegra/bpmp-private.h b/drivers/firmware/tegra/bpmp-private.h
index 54d560c48398..182bfe396516 100644
--- a/drivers/firmware/tegra/bpmp-private.h
+++ b/drivers/firmware/tegra/bpmp-private.h
@@ -24,7 +24,8 @@  struct tegra_bpmp_ops {
 };
 
 #if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC) || \
-    IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC)
+    IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
+    IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC)
 extern const struct tegra_bpmp_ops tegra186_bpmp_ops;
 #endif
 #if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
index 0742a90cb844..5654c5e9862b 100644
--- a/drivers/firmware/tegra/bpmp.c
+++ b/drivers/firmware/tegra/bpmp.c
@@ -809,7 +809,8 @@  static const struct dev_pm_ops tegra_bpmp_pm_ops = {
 };
 
 #if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC) || \
-    IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC)
+    IS_ENABLED(CONFIG_ARCH_TEGRA_194_SOC) || \
+    IS_ENABLED(CONFIG_ARCH_TEGRA_234_SOC)
 static const struct tegra_bpmp_soc tegra186_soc = {
 	.channels = {
 		.cpu_tx = {