summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-bcm/bcm_kona_smc.c
diff options
context:
space:
mode:
authorChristian Daudt <csd@broadcom.com>2013-08-06 17:04:54 -0700
committerChristian Daudt <csd@broadcom.com>2013-08-20 10:51:39 -0700
commit3a76b35186cb967a69c4a3935caf2fdf428e933b (patch)
treed26dd20cad8966e895b642c282f115dd8a75e071 /arch/arm/mach-bcm/bcm_kona_smc.c
parentaea237bfa0a8ce8fe364e3fa7de6850777044a60 (diff)
downloadtalos-obmc-linux-3a76b35186cb967a69c4a3935caf2fdf428e933b.tar.gz
talos-obmc-linux-3a76b35186cb967a69c4a3935caf2fdf428e933b.zip
ARM: bcm: Make secure API call optional
The current bcm_kona_smc_init function throws a BUG_ON if there's no SMC device node defined in the device tree. Since secure API access is optional depending the chip configuration, fix this by allowing the rest of the code to run even if there's no SMC device node defined Signed-off-by: Christian Daudt <csd@broadcom.com> Reviewed-by: Markus Mayer <markus.mayer@linaro.org>
Diffstat (limited to 'arch/arm/mach-bcm/bcm_kona_smc.c')
-rw-r--r--arch/arm/mach-bcm/bcm_kona_smc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c
index bcc1c5903fb1..5e31e918f325 100644
--- a/arch/arm/mach-bcm/bcm_kona_smc.c
+++ b/arch/arm/mach-bcm/bcm_kona_smc.c
@@ -42,13 +42,14 @@ static const struct of_device_id bcm_kona_smc_ids[] __initconst = {
};
/* Map in the bounce area */
-void __init bcm_kona_smc_init(void)
+int __init bcm_kona_smc_init(void)
{
struct device_node *node;
/* Read buffer addr and size from the device tree node */
node = of_find_matching_node(NULL, bcm_kona_smc_ids);
- BUG_ON(!node);
+ if (!node)
+ return -ENODEV;
/* Don't care about size or flags of the DT node */
bridge_data.buffer_addr =
@@ -60,7 +61,9 @@ void __init bcm_kona_smc_init(void)
bridge_data.initialized = 1;
- pr_info("Secure API initialized!\n");
+ pr_info("Kona Secure API initialized\n");
+
+ return 0;
}
/* __bcm_kona_smc() should only run on CPU 0, with pre-emption disabled */
OpenPOWER on IntegriCloud