return ret;
}
-static int sbi_ecall_cppc_probe(unsigned long extid, unsigned long *out_val)
-{
- *out_val = sbi_cppc_get_device() ? 1 : 0;
- return 0;
-}
-
struct sbi_ecall_extension ecall_cppc;
static int sbi_ecall_cppc_register_extensions(void)
.extid_start = SBI_EXT_CPPC,
.extid_end = SBI_EXT_CPPC,
.register_extensions = sbi_ecall_cppc_register_extensions,
- .probe = sbi_ecall_cppc_probe,
.handle = sbi_ecall_cppc_handler,
};
return SBI_ENOTSUPP;
}
-static int sbi_ecall_dbcn_probe(unsigned long extid, unsigned long *out_val)
-{
- *out_val = sbi_console_get_device() ? 1 : 0;
- return 0;
-}
-
struct sbi_ecall_extension ecall_dbcn;
static int sbi_ecall_dbcn_register_extensions(void)
.extid_start = SBI_EXT_DBCN,
.extid_end = SBI_EXT_DBCN,
.register_extensions = sbi_ecall_dbcn_register_extensions,
- .probe = sbi_ecall_dbcn_probe,
.handle = sbi_ecall_dbcn_handler,
};
return SBI_ENOTSUPP;
}
-static int sbi_ecall_srst_probe(unsigned long extid, unsigned long *out_val)
+static bool srst_available(void)
{
u32 type;
* At least one standard reset types should be supported by
* the platform for SBI SRST extension to be usable.
*/
-
for (type = 0; type <= SBI_SRST_RESET_TYPE_LAST; type++) {
if (sbi_system_reset_supported(type,
- SBI_SRST_RESET_REASON_NONE)) {
- *out_val = 1;
- return 0;
- }
+ SBI_SRST_RESET_REASON_NONE))
+ return true;
}
- *out_val = 0;
- return 0;
+ return false;
}
struct sbi_ecall_extension ecall_srst;
static int sbi_ecall_srst_register_extensions(void)
{
- unsigned long out_val;
-
- sbi_ecall_srst_probe(SBI_EXT_SRST, &out_val);
- if (!out_val)
+ if (!srst_available())
return 0;
return sbi_ecall_register_extension(&ecall_srst);
.extid_start = SBI_EXT_SRST,
.extid_end = SBI_EXT_SRST,
.register_extensions = sbi_ecall_srst_register_extensions,
- .probe = sbi_ecall_srst_probe,
.handle = sbi_ecall_srst_handler,
};
return ret;
}
-static int sbi_ecall_susp_probe(unsigned long extid, unsigned long *out_val)
+static bool susp_available(void)
{
u32 type;
* platform for the SBI SUSP extension to be usable.
*/
for (type = 0; type <= SBI_SUSP_SLEEP_TYPE_LAST; type++) {
- if (sbi_system_suspend_supported(type)) {
- *out_val = 1;
- return 0;
- }
+ if (sbi_system_suspend_supported(type))
+ return true;
}
- *out_val = 0;
- return 0;
+ return false;
}
struct sbi_ecall_extension ecall_susp;
static int sbi_ecall_susp_register_extensions(void)
{
- unsigned long out_val;
-
- sbi_ecall_susp_probe(SBI_EXT_SUSP, &out_val);
- if (!out_val)
+ if (!susp_available())
return 0;
return sbi_ecall_register_extension(&ecall_susp);
.extid_start = SBI_EXT_SUSP,
.extid_end = SBI_EXT_SUSP,
.register_extensions = sbi_ecall_susp_register_extensions,
- .probe = sbi_ecall_susp_probe,
.handle = sbi_ecall_susp_handler,
};