]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: unify code for memory access from debugfs
authorDafna Hirschfeld <dhirschfeld@habana.ai>
Wed, 23 Mar 2022 15:21:56 +0000 (17:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 May 2022 19:01:16 +0000 (21:01 +0200)
commit35252154db071383d316e3f4446d21e57a5d6454
tree70852319f6a8e7c49d097f5cb21d5a91217d6a36
parentf1e045a960295e2015f6a6c270c7fb993401f17d
habanalabs: unify code for memory access from debugfs

Currently each asic version implements 4 callbacks:
'debugfs_{read32/write32/read64/write64}'
There is a lot of code duplication among the different
callbacks of all asic versions.
This patch unify the code in order to avoid the code
duplication by iterating the pci_mem_region array
in hl_device and use its fields instead of macros.

Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/common/debugfs.c