diff options
author | Alex Elder <elder@linaro.org> | 2020-05-04 19:58:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-04 20:26:55 +0200 |
commit | 3128aae8c439af18048167e3cd5e31680cd190b9 (patch) | |
tree | 2eef7304a7eeaf245a1c860ed6dabb01520de1e6 /drivers/net/ipa/ipa_mem.c | |
parent | dt-bindings: net: add IPA iommus property (diff) | |
download | linux-3128aae8c439af18048167e3cd5e31680cd190b9.tar.xz linux-3128aae8c439af18048167e3cd5e31680cd190b9.zip |
net: ipa: redefine struct ipa_mem_data
The ipa_mem_data structure type was never actually used. Instead,
the IPA memory regions were defined using the ipa_mem structure.
Redefine struct ipa_mem_data so it encapsulates the array of IPA-local
memory region descriptors along with the count of entries in that
array. Pass just an ipa_mem structure pointer to ipa_mem_init().
Rename the ipa_mem_data[] array ipa_mem_local_data[] to emphasize
that the memory regions it defines are IPA-local memory.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipa/ipa_mem.c')
-rw-r--r-- | drivers/net/ipa/ipa_mem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ipa/ipa_mem.c b/drivers/net/ipa/ipa_mem.c index 42d2c29d9f0c..fb4de2a12796 100644 --- a/drivers/net/ipa/ipa_mem.c +++ b/drivers/net/ipa/ipa_mem.c @@ -12,6 +12,7 @@ #include "ipa.h" #include "ipa_reg.h" +#include "ipa_data.h" #include "ipa_cmd.h" #include "ipa_mem.h" #include "ipa_data.h" @@ -266,15 +267,15 @@ int ipa_mem_zero_modem(struct ipa *ipa) } /* Perform memory region-related initialization */ -int ipa_mem_init(struct ipa *ipa, u32 count, const struct ipa_mem *mem) +int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) { struct device *dev = &ipa->pdev->dev; struct resource *res; int ret; - if (count > IPA_MEM_COUNT) { + if (mem_data->local_count > IPA_MEM_COUNT) { dev_err(dev, "to many memory regions (%u > %u)\n", - count, IPA_MEM_COUNT); + mem_data->local_count, IPA_MEM_COUNT); return -EINVAL; } @@ -302,7 +303,7 @@ int ipa_mem_init(struct ipa *ipa, u32 count, const struct ipa_mem *mem) ipa->mem_size = resource_size(res); /* The ipa->mem[] array is indexed by enum ipa_mem_id values */ - ipa->mem = mem; + ipa->mem = mem_data->local; return 0; } |