From 9e3a2d05a62f7376995689aae2bc27c9e0a84acd Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 30 Sep 2023 16:10:53 +0000 Subject: [PATCH] ANDROID: GKI: Fix firmware: smccc build error In commit 0ca5de8309f9 ("firmware: smccc: Fix use of uninitialised results structure"), a unused variable was removed, but in the android-specific changes in the function, the variable was still needed, so it broke the build. Fix this up by putting the variable back as it is required and set it properly. Fixes: 0ca5de8309f9 ("firmware: smccc: Fix use of uninitialised results structure") Change-Id: Icef4bcc0403f4f09fb7ca3a72346007af79f7f8e Signed-off-by: Greg Kroah-Hartman --- drivers/firmware/smccc/soc_id.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/firmware/smccc/soc_id.c b/drivers/firmware/smccc/soc_id.c index 29299ff5e7db..1a466f5687f1 100644 --- a/drivers/firmware/smccc/soc_id.c +++ b/drivers/firmware/smccc/soc_id.c @@ -34,6 +34,7 @@ static struct soc_device_attribute *soc_dev_attr; static int __init smccc_soc_init(void) { + struct arm_smccc_res res; int soc_id_rev, soc_id_version; static char soc_id_str[20], soc_id_rev_str[12]; static char soc_id_jep106_id_str[12]; @@ -54,17 +55,7 @@ static int __init smccc_soc_init(void) return 0; } - if (soc_id_version < 0) { - pr_err("Invalid SoC Version: %x\n", soc_id_version); - return -EINVAL; - } - - soc_id_rev = arm_smccc_get_soc_id_revision(); - if (soc_id_rev < 0) { - pr_err("Invalid SoC Revision: %x\n", soc_id_rev); - return -EINVAL; - } - + soc_id_version = arm_smccc_get_version(); soc_id_rev = res.a0; soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);