diff mbox series

[1/2] firmware: tegra: Conditionally support SoC generations

Message ID 20190207115006.8162-1-thierry.reding@gmail.com
State Accepted
Headers show
Series [1/2] firmware: tegra: Conditionally support SoC generations | expand

Commit Message

Thierry Reding Feb. 7, 2019, 11:50 a.m. UTC
From: Thierry Reding <treding@nvidia.com>

Only include support for Tegra210 and Tegra186 in the BPMP driver if
support for those SoCs was selected. This fixes a build failure seen
on 32-bit ARM allmodconfig builds, but could also happen on 64-bit
ARM builds if either Tegra210 or Tegra186 were not selected.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/firmware/tegra/bpmp-private.h | 4 ++++
 drivers/firmware/tegra/bpmp.c         | 8 ++++++++
 2 files changed, 12 insertions(+)

Comments

Timo Alho Feb. 7, 2019, 12:03 p.m. UTC | #1
On 7.2.2019 13.50, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Only include support for Tegra210 and Tegra186 in the BPMP driver if
> support for those SoCs was selected. This fixes a build failure seen
> on 32-bit ARM allmodconfig builds, but could also happen on 64-bit
> ARM builds if either Tegra210 or Tegra186 were not selected.
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/firmware/tegra/bpmp-private.h | 4 ++++
>   drivers/firmware/tegra/bpmp.c         | 8 ++++++++
>   2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/firmware/tegra/bpmp-private.h b/drivers/firmware/tegra/bpmp-private.h
> index 07c3d46abb87..cc343f4ebafb 100644
> --- a/drivers/firmware/tegra/bpmp-private.h
> +++ b/drivers/firmware/tegra/bpmp-private.h
> @@ -23,7 +23,11 @@ struct tegra_bpmp_ops {
>   	int (*resume)(struct tegra_bpmp *bpmp);
>   };
>   
> +#if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC)
>   extern const struct tegra_bpmp_ops tegra186_bpmp_ops;
> +#endif
> +#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
>   extern const struct tegra_bpmp_ops tegra210_bpmp_ops;
> +#endif
>   
>   #endif
> diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
> index 8e3f79959d48..6498c848c82c 100644
> --- a/drivers/firmware/tegra/bpmp.c
> +++ b/drivers/firmware/tegra/bpmp.c
> @@ -813,6 +813,7 @@ static int __maybe_unused tegra_bpmp_resume(struct device *dev)
>   
>   static SIMPLE_DEV_PM_OPS(tegra_bpmp_pm_ops, NULL, tegra_bpmp_resume);
>   
> +#if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC)
>   static const struct tegra_bpmp_soc tegra186_soc = {
>   	.channels = {
>   		.cpu_tx = {
> @@ -832,7 +833,9 @@ static const struct tegra_bpmp_soc tegra186_soc = {
>   	.ops = &tegra186_bpmp_ops,
>   	.num_resets = 193,
>   };
> +#endif
>   
> +#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
>   static const struct tegra_bpmp_soc tegra210_soc = {
>   	.channels = {
>   		.cpu_tx = {
> @@ -853,10 +856,15 @@ static const struct tegra_bpmp_soc tegra210_soc = {
>   	},
>   	.ops = &tegra210_bpmp_ops,
>   };
> +#endif
>   
>   static const struct of_device_id tegra_bpmp_match[] = {
> +#if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC)
>   	{ .compatible = "nvidia,tegra186-bpmp", .data = &tegra186_soc },
> +#endif
> +#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
>   	{ .compatible = "nvidia,tegra210-bpmp", .data = &tegra210_soc },
> +#endif
>   	{ }
>   };
>   
> 

Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/firmware/tegra/bpmp-private.h b/drivers/firmware/tegra/bpmp-private.h
index 07c3d46abb87..cc343f4ebafb 100644
--- a/drivers/firmware/tegra/bpmp-private.h
+++ b/drivers/firmware/tegra/bpmp-private.h
@@ -23,7 +23,11 @@  struct tegra_bpmp_ops {
 	int (*resume)(struct tegra_bpmp *bpmp);
 };
 
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC)
 extern const struct tegra_bpmp_ops tegra186_bpmp_ops;
+#endif
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
 extern const struct tegra_bpmp_ops tegra210_bpmp_ops;
+#endif
 
 #endif
diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
index 8e3f79959d48..6498c848c82c 100644
--- a/drivers/firmware/tegra/bpmp.c
+++ b/drivers/firmware/tegra/bpmp.c
@@ -813,6 +813,7 @@  static int __maybe_unused tegra_bpmp_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(tegra_bpmp_pm_ops, NULL, tegra_bpmp_resume);
 
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC)
 static const struct tegra_bpmp_soc tegra186_soc = {
 	.channels = {
 		.cpu_tx = {
@@ -832,7 +833,9 @@  static const struct tegra_bpmp_soc tegra186_soc = {
 	.ops = &tegra186_bpmp_ops,
 	.num_resets = 193,
 };
+#endif
 
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
 static const struct tegra_bpmp_soc tegra210_soc = {
 	.channels = {
 		.cpu_tx = {
@@ -853,10 +856,15 @@  static const struct tegra_bpmp_soc tegra210_soc = {
 	},
 	.ops = &tegra210_bpmp_ops,
 };
+#endif
 
 static const struct of_device_id tegra_bpmp_match[] = {
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_186_SOC)
 	{ .compatible = "nvidia,tegra186-bpmp", .data = &tegra186_soc },
+#endif
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
 	{ .compatible = "nvidia,tegra210-bpmp", .data = &tegra210_soc },
+#endif
 	{ }
 };