[PATCH v2 10/15] soc: qcom: smem: stub functions
Neil Armstrong
neil.armstrong at linaro.org
Mon May 18 16:37:57 CEST 2026
On 5/4/26 20:57, Casey Connolly wrote:
> Allow smem to be optional for Qualcomm platforms by providing stub
> functions.
>
> Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
> ---
> include/soc/qcom/smem.h | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/include/soc/qcom/smem.h b/include/soc/qcom/smem.h
> index 755003807dba..586432412eb8 100644
> --- a/include/soc/qcom/smem.h
> +++ b/include/soc/qcom/smem.h
> @@ -1,16 +1,36 @@
> /* SPDX-License-Identifier: GPL-2.0 */
> #ifndef __QCOM_SMEM_H__
> #define __QCOM_SMEM_H__
>
> +#include <linux/err.h>
> +#include <stdbool.h>
> +
> #define QCOM_SMEM_HOST_ANY -1
>
> +#if defined(CONFIG_QCOM_SMEM)
> int qcom_smem_init(void);
> int qcom_socinfo_init(void);
>
> bool qcom_smem_is_available(void);
> int qcom_smem_alloc(unsigned host, unsigned item, size_t size);
> void *qcom_smem_get(unsigned host, unsigned item, size_t *size);
>
> int qcom_smem_get_free_space(unsigned host);
> +#else
> +static int qcom_smem_init(void) { return -ENOSYS; }
> +
> +static bool qcom_smem_is_available(void) { return false; }
> +int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
> +{
> + return -ENOSYS;
> +}
> +
> +void *qcom_smem_get(unsigned host, unsigned item, size_t *size)
> +{
> + return ERR_PTR(-ENOSYS);
> +}
> +
> +int qcom_smem_get_free_space(unsigned host);
> +#endif
>
> #endif
>
Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>
Thanks,
Neil
More information about the U-Boot
mailing list