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>
Bu işleme şunda yer alıyor:
Christian Daudt
2013-08-06 17:04:54 -07:00
ebeveyn aea237bfa0
işleme 3a76b35186
3 değiştirilmiş dosya ile 13 ekleme ve 8 silme

Dosyayı Görüntüle

@@ -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 */