From 4375fddf0b05817af228a3211294abd971ad81e0 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Fri, 29 May 2020 12:56:41 -0700 Subject: [PATCH] soc: qcom: mem-buf: Fix compilation errors when hotplug is disabled The mem-buf driver cannot compile when the memory hotplug configurations are disabled. In certain environments, mem-buf does not require memory hotplug functionality (i.e. when the mem-buf driver acts as a supplier), so stub out the memory-hotplug calls if memory hotplug is not enabled. Change-Id: Id1305358c84a0c4cd19cb539254bb6c4f8b2fb90 Signed-off-by: Isaac J. Manjarres --- drivers/soc/qcom/mem-buf.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/soc/qcom/mem-buf.c b/drivers/soc/qcom/mem-buf.c index 969fb10585fe..eaf4519e95d5 100644 --- a/drivers/soc/qcom/mem-buf.c +++ b/drivers/soc/qcom/mem-buf.c @@ -964,6 +964,7 @@ static void mem_buf_unmap_mem_s2(struct mem_buf_desc *membuf) kfree(membuf->sgl_desc); } +#ifdef CONFIG_MEMORY_HOTPLUG static int mem_buf_map_mem_s1(struct mem_buf_desc *membuf) { int i, ret; @@ -1001,7 +1002,14 @@ err_add_mem: mem_hotplug_done(); return ret; } +#else /* CONFIG_MEMORY_HOTPLUG */ +static inline int mem_buf_map_mem_s1(struct mem_buf_desc *membuf) +{ + return -EINVAL; +} +#endif /* CONFIG_MEMORY_HOTPLUG */ +#ifdef CONFIG_MEMORY_HOTREMOVE static void mem_buf_unmap_mem_s1(struct mem_buf_desc *membuf) { unsigned int i, nid; @@ -1019,6 +1027,11 @@ static void mem_buf_unmap_mem_s1(struct mem_buf_desc *membuf) mem_hotplug_done(); } +#else /* CONFIG_MEMORY_HOTREMOVE */ +static inline void mem_buf_unmap_mem_s1(struct mem_buf_desc *membuf) +{ +} +#endif /* CONFIG_MEMORY_HOTREMOVE */ static int mem_buf_add_ion_mem(struct sg_table *sgt, void *dst_data) {