From 5e3bc1e5d0021c2efcbc8ba7da7b96c6a502d8bf Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Thu, 10 Jun 2021 14:23:07 -0500 Subject: net: ipa: introduce ipa_mem_find() Introduce a new function that abstracts finding information about a region in IPA-local memory, given its memory region ID. For now it simply uses the region ID as an index into the IPA memory array. If the region is not defined, ipa_mem_find() returns a null pointer. Update all code that accesses the ipa->mem[] array directly to use ipa_mem_find() instead. The return value must be checked for null when optional memory regions are sought. Signed-off-by: Alex Elder Signed-off-by: David S. Miller --- drivers/net/ipa/ipa_mem.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/ipa/ipa_mem.h') diff --git a/drivers/net/ipa/ipa_mem.h b/drivers/net/ipa/ipa_mem.h index effe01f7310a..712b2881be0c 100644 --- a/drivers/net/ipa/ipa_mem.h +++ b/drivers/net/ipa/ipa_mem.h @@ -90,6 +90,8 @@ struct ipa_mem { u16 canary_count; }; +const struct ipa_mem *ipa_mem_find(struct ipa *ipa, enum ipa_mem_id mem_id); + int ipa_mem_config(struct ipa *ipa); void ipa_mem_deconfig(struct ipa *ipa); -- cgit