drivers/soc/litex: make 'litex_[set|get]_reg()' methods private
authorGabriel Somlo <gsomlo@gmail.com>
Tue, 12 Jan 2021 17:31:44 +0000 (12:31 -0500)
committerStafford Horne <shorne@gmail.com>
Thu, 14 Jan 2021 00:52:54 +0000 (09:52 +0900)
commit4f70d150294b3ddfbe4be7130ca53898cd5b91be
treeae8e087a2f74bacfda26c3f3de814f9083a9eab0
parent51f109228308a87c7f2583360e54acfc567203da
drivers/soc/litex: make 'litex_[set|get]_reg()' methods private

The 'litex_[set|get]_reg()' methods use the 'reg_size' parameter to
specify the width of the LiteX CSR (MMIO) register being accessed.

Since 'u64' is the widest data being supported, the value of 'reg_size'
MUST be between 1 and sizeof(u64), which SHOULD be checked at runtime
if these methods are publicly available for use by other LiteX device
drivers.

At the same time, none of the existing (or foreseeable) LiteX device
drivers have a need to access registers whose size is unknown during
compilation. As such, all LiteX device drivers should use fixed-width
accessor methods such as 'litex_[write|read][8|16|32|64]()'.

This patch renames 'litex_[set|get]_reg()' to '_litex_[set|get]_reg()',
indicating that they should NOT be directly called from outside of
the 'include/linux/litex.h' header file.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
Signed-off-by: Stafford Horne <shorne@gmail.com>
drivers/soc/litex/Kconfig
include/linux/litex.h