@@ -359,6 +359,15 @@ static struct qcom_smem *__smem;
/* Timeout (ms) for the trylock of remote spinlocks */
#define HWSPINLOCK_TIMEOUT 1000
+/**
+ * qcom_smem_is_available() - Checks if SMEM is available
+ */
+bool qcom_smem_is_available(void)
+{
+ return !!__smem;
+}
+EXPORT_SYMBOL(qcom_smem_is_available);
+
static int qcom_smem_alloc_private(struct qcom_smem *smem,
struct smem_partition *part,
unsigned item,
@@ -4,6 +4,7 @@
#define QCOM_SMEM_HOST_ANY -1
+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);
Avoid having to look up a dummy item from SMEM to detect if it is already available or if we need to defer probing. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> --- drivers/soc/qcom/smem.c | 9 +++++++++ include/linux/soc/qcom/smem.h | 1 + 2 files changed, 10 insertions(+)