net: ipa: introduce ipa_reg()
authorAlex Elder <elder@linaro.org>
Mon, 26 Sep 2022 22:09:21 +0000 (17:09 -0500)
committerJakub Kicinski <kuba@kernel.org>
Wed, 28 Sep 2022 01:42:50 +0000 (18:42 -0700)
commit6a244b75cfab95ddd505fc9a80af76bf36071784
tree3f036c90ca167cf8de45250aedb139d19f58f121
parent82a06807453a6c0c282b3238f28164970100ffcd
net: ipa: introduce ipa_reg()

Create a new function that returns a register descriptor given its
ID.  Change ipa_reg_offset() and ipa_reg_n_offset() so they take a
register descriptor argument rather than an IPA pointer and register
ID.  Have them accept null pointers (and return an invalid 0 offset),
to avoid the need for excessive error checking.  (A warning is issued
whenever ipa_reg() returns 0).

Call ipa_reg() or ipa_reg_n() to look up information about the
register before calls to ipa_reg_offset() and ipa_reg_n_offset().
Delay looking up offsets until they're needed to read or write
registers.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_cmd.c
drivers/net/ipa/ipa_endpoint.c
drivers/net/ipa/ipa_interrupt.c
drivers/net/ipa/ipa_main.c
drivers/net/ipa/ipa_mem.c
drivers/net/ipa/ipa_reg.c
drivers/net/ipa/ipa_reg.h
drivers/net/ipa/ipa_resource.c
drivers/net/ipa/ipa_table.c
drivers/net/ipa/ipa_uc.c