diff options
author | Alex Elder <elder@linaro.org> | 2021-06-10 14:23:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-10 14:50:08 -0700 |
commit | 5e3bc1e5d0021c2efcbc8ba7da7b96c6a502d8bf (patch) | |
tree | 318480594466e478e5e245e8160906107ffa9751 /drivers/net/ipa/ipa_table.c | |
parent | net: ipa: pass memory id to ipa_table_valid_one() (diff) | |
download | linux-dev-5e3bc1e5d0021c2efcbc8ba7da7b96c6a502d8bf.tar.xz linux-dev-5e3bc1e5d0021c2efcbc8ba7da7b96c6a502d8bf.zip |
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 <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_table.c')
-rw-r--r-- | drivers/net/ipa/ipa_table.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c index 679855b1d549..c617a9156f26 100644 --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -152,7 +152,7 @@ static void ipa_table_validate_build(void) static bool ipa_table_valid_one(struct ipa *ipa, enum ipa_mem_id mem_id, bool route) { - const struct ipa_mem *mem = &ipa->mem[mem_id]; + const struct ipa_mem *mem = ipa_mem_find(ipa, mem_id); struct device *dev = &ipa->pdev->dev; u32 size; @@ -245,7 +245,7 @@ static void ipa_table_reset_add(struct gsi_trans *trans, bool filter, u16 first, u16 count, enum ipa_mem_id mem_id) { struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); - const struct ipa_mem *mem = &ipa->mem[mem_id]; + const struct ipa_mem *mem = ipa_mem_find(ipa, mem_id); dma_addr_t addr; u32 offset; u16 size; @@ -417,8 +417,8 @@ static void ipa_table_init_add(struct gsi_trans *trans, bool filter, enum ipa_mem_id hash_mem_id) { struct ipa *ipa = container_of(trans->gsi, struct ipa, gsi); - const struct ipa_mem *hash_mem = &ipa->mem[hash_mem_id]; - const struct ipa_mem *mem = &ipa->mem[mem_id]; + const struct ipa_mem *hash_mem = ipa_mem_find(ipa, hash_mem_id); + const struct ipa_mem *mem = ipa_mem_find(ipa, mem_id); dma_addr_t hash_addr; dma_addr_t addr; u16 hash_count; |